View and collect Home page metrics
Use the HomepageMetricsService commands and Server Metrics page to monitor product usage, and to make configuration adjustments when necessary.
Before starting
To use administrative commands, use the wsadmin client. See Starting the wsadmin client for details.
About this task
Metrics are frequency data that are recorded about the database state. There are two ways to view and collect metrics. The simplest way is to enter the URL below or select Server Metrics from the site footer to see some of the most relevant metrics available for the application.
http://<servername.com:port>/homepage/web/servermetricswhere <servername.com:port> is the appropriate host name and port number for your server.
Notes:
- Administrators can restrict access to metrics by specifying the metrics-reader role. For information, see the topic Roles.
- The metrics are cached for one hour. For performance reasons, they are not collected from the database more than once an hour.
You can collect the following metrics for the Home page:
Table 1. Home page metrics
Metric
Description
homepage.metric.topWidgets*
5 most popular widgets and their count
homepage.metric.totals.available.widgets
Total number of widgets deployed in the Home page
homepage.metric.totals.customizedPages*
Total number of users with a customized Widgets tab
homepage.metric.totals.enabled.widgets
Total number of widgets currently enabled and available to users on the Home page
homepage.metric.totals.receivedNotifications*
Total number of notifications received
homepage.metric.totals.receivedNotifications.month*
Total number of notifications received in the past 30 days
homepage.metric.totals.receivedNotifications.today*
Total number of notifications received in the past 24 hours
homepage.metric.totals.receivedNotifications.week*
Total number of notifications received in the past 7 days
homepage.metric.totals.sentNotifications*
Total number of notifications sent by the system and other users
homepage.metric.totals.sentNotifications.month*
Total number of notifications sent by the system and other users in the past 30 days
homepage.metric.totals.sentNotifications.today*
Total number of notifications sent by the system and other users in the past 24 hours
homepage.metric.totals.sentNotifications.week*
Total number of notifications sent by the system and other users in the past 7 days
homepage.metric.totals.stories.added*
Total number of stories added to the Home page
homepage.metric.totals.stories.added.month*
Total number of stories added to the Home page in the past 30 days
homepage.metric.totals.stories.added.today*
Total number of stories added to the Home page in the past 24 hours
homepage.metric.totals.stories.added.week*
Total number of stories added to the Home page in the past 7 days
homepage.metric.totals.stories.saved*
Total number of stories saved on the Updates tab
homepage.metric.totals.stories.saved.month*
Total number of stories saved on the Updates tab in the past 30 days
homepage.metric.totals.stories.saved.today*
Total number of stories saved on the Updates tab in the past 24 hours
homepage.metric.totals.stories.saved.week*
Total number of stories saved on the Updates tab in the past 7 days
homepage.metric.totals.visitor
Total number of unique users who have accessed the Home page feature
homepage.metric.totals.visitor.month
Total number of unique visitors to the Home page in the past 30 days
homepage.metric.totals.visitor.today
Total number of unique visitors to the Home page in the past 24 hours
homepage.metric.totals.visitor.week
Total number of unique visitors to the Home page in the past 7 days
Note: The metrics flagged with an asterisk (*) were added in IBM Connections 3.
Procedure
You can also follow these steps to return metrics using administrative commands. No file check out or server restart is required when using these commands.
- Start the wsadmin client from the following directory of the system on which you installed the deployment manager: .
app_server_root>\profiles\<dm_profile_root>\bin
where <app_server_root> is the WAS installation directory and <dm_profile_root> is the dmgr profile directory, typically dmgr01.
You must start the client from this directory or subsequent commands that you enter do not execute correctly. For more information, see Starting the wsadmin client.
- Start the Home page Jython script interpreter.
- Access the Home page configuration files.
execfile("homepageAdmin.py")
If prompted to specify a service to connect to, type 1 to pick the first node in the list. Most commands can run on any node. If the command writes or reads information to or from a file using a local file path, pick the node where the file is stored.
- Enter one of the following commands to collect the current metrics for the Home page.
- To collect all the metrics at once, and have them returned as a hashtable:
HomepageMetricsService.fetchMetrics()
- To collect a single metric:
HomepageMetricsService.fetchMetric("<metric_to_fetch>")
- where <metric_to_fetch> is one of the metrics defined in the metrics table above.
For example:
HomepageMetricsService.fetchMetric("homepage.metric.totals.visitor") HomepageMetricsService.fetchMetric("homepage.metric.totals.stories.added.today") HomepageMetricsService.fetchMetric("homepage.metric.totals.sentNotifications") HomepageMetricsService.fetchMetric("homepage.metric.totals.receivedNotifications") HomepageMetricsService.fetchMetric("homepage.metric.totals.stories.saved") HomepageMetricsService.fetchMetric("homepage.metric.topWidgets") HomepageMetricsService.fetchMetric("homepage.metric.totals.customizedPages")
- Use one of the following commands to write metrics to a specified file.
- To write all the metrics to a file:
HomepageMetricsService.saveMetricToFile("<file_name>", <number>,"all")
- where you provide values for the following variables:
- <file_name>. Path to a file in which to export the metrics. Metrics are exported in comma separated value (CSV) format. If you specify a file name with a .csv extension, it is possible to open it as a spreadsheet. See Importing statistics and metrics into a spreadsheet.
Tip: If the metrics are being kept over a period of time, consider using a universal file path so that the command can be run on any node with the metrics saved to the same file. For example:
HomepageMetricsService.saveMetricToFile("\\9.32.168.90\c$\IBM\LotusConnections\Data\homepage\metrics\AllMetrics.csv", 40, "all")
- <number>. The number of entries to persist in the file. If you specify 20, and add one new entry to the file, the file retains the last 19 entries and adds your new entry. Any older entries are deleted.
For example:
HomepageMetricsService.saveMetricToFile("C:\IBM\LotusConnections\Data\homepage\metrics\AllMetrics.csv",40,"all")
- To write one metric to a file:
HomepageMetricsService.saveMetricToFile("<file_name>", <number>,"<metric_to_save>")
- where you provide values for the following variables:
- <file_name>. Path to a file in which to export the metrics. Metrics are exported in comma separated value (CSV) format. If you specify a file name with a .csv extension, it is possible to open it as a spreadsheet. See Importing statistics and metrics into a spreadsheet.
Tip: If the metrics are being kept over a period of time, consider using a universal file path so that the command can be run on any node with the metrics saved to the same file. For example:
HomepageMetricsService.saveMetricToFile(“\\9.32.168.90\c$\IBM\LotusConnections\Data\homepage\metrics\AllMetrics.csv”, 40, “all”)
- <number>. The number of entries to persist in the file. If you specify 20, and add one new entry to the file, the file retains the last 19 entries and adds your new entry. Any older entries are deleted.
- <metric_to_save>. The metric that you want to write to the file.
For example:
HomepageMetricsService.saveMetricToFile("C:\IBM\LotusConnections\Data\homepage\metrics\TotVisitor.csv",40, "homepage.metric.totals.visitor") HomepageMetricsService.saveMetricToFile("C:\IBM\LotusConnections\Data\homepage\metrics\TotStoriesAdded.csv",40, "homepage.metric.totals.stories.added") HomepageMetricsService.saveMetricToFile("C:\IBM\LotusConnections\Data\homepage\metrics\TotNotifRecd.csv",40, "homepage.metric.totals.receivedNotifications") HomepageMetricsService.saveMetricToFile("C:\IBM\LotusConnections\Data\homepage\metrics\TotSavedStories.csv",40, "homepage.metric.totals.stories.saved") HomepageMetricsService.saveMetricToFile("C:\IBM\LotusConnections\Data\homepage\metrics\TopWidgets.csv",40, "homepage.metric.topWidgets") HomepageMetricsService.saveMetricToFile("C:\IBM\LotusConnections\Data\homepage\metrics\TotCustomPages.csv",40, "homepage.metric.totals.customizedPages") HomepageMetricsService.saveMetricToFile("C:\IBM\LotusConnections\Data\homepage\metrics\TotEnabledWidgets.csv",40, "homepage.metric.totals.enabled.widgets")
- To write a subset of metrics to a file:
- Define an ArrayList Java™ object variable named fldkeys.
- Add the subset of metrics that you want to write to a file to the array. For example:
from java.util import ArrayList fldkeys=ArrayList() fldkeys.add("homepage.metric.totals.visitor") fldkeys.add("homepage.metric.topWidgets") fldkeys.add("homepage.metric.totals.enabled.widgets")
- Use the following command to write the subset of metrics to a file:
HomepageMetricsService.saveMetricsToFile("C:\IBM\LotusConnections\Data\homepage\metrics\MetList.csv",60,fldkeys)
Parent topic
Administer the Home page using the wsadmin clientRelated concepts
Collecting metrics
Related tasks
Importing statistics and metrics into a spreadsheetRelated reference
Roles