Home

 

Collect Activities metrics and writing them to a file

Use administrative commands to collect metrics and write them to a file.


There are two ways to view and collect metrics. The simplest way is to view the full set of metrics available for the feature from a Web page. The second way is to use the wsadmin tool to collect the metrics. The second method takes more work, but it also provides you with results that you can write to a file.

Whichever method you use, the results are cached for one hour. If you attempt to collect metrics data again within that hour, the same numbers are displayed because they are read from the cache. After the cache expires and you request metrics data, the database is queried and the numbers are updated. To see the Activities metrics, go to the following Web page:

where <servername.com:port> is the host name and port number for your server. You can collect the following metrics for Activities:


Activities metrics

Description Wsadmin metric key
Number of users logged in the last week. activities.metric.distinct.loggedin7days
Total number of distinct owners. This number helps you determine how many people are creating activities versus those who are participating in existing activities. activities.metric.distinct.owners
Total number of activities. activities.metric.total.activities
Total number of creators of greater than 2 activities. This number helps you to determine if just one or two people are creating all of the activities or if many people are creating activities. activities.metric.total.creators
Total number of entries. You can compare the number of entries to the number of activities to determine how active the existing activities are. The larger the ratio, the more active the activities. activities.metric.total.entries
Number of users logged in today. activities.metric.total.loggedin1day
Number of users logged in the last month. activities.metric.total.loggedin30days
Total number of distinct members. People who are members of more than one activity are counted only once. activities.metric.total.members

Use wsadmin


To collect metrics and write them to a file...

  1. Start the Activities Jython script interpreter.

    1. Access the Activities configuration file:

    2. Network deployment:

        execfile("profile_root/config/bin_lc_admin/activitiesAdmin.py")
        

      If prompted to specify which server to connect to, type 1.

      The information about which server to connect to is only used by wsadmin when you are running administrative commands to collect statistics.

  2. Enter one of the following commands to collect the current metrics:

    • To collect all of the metrics at once, and have them returned as a hash table:

        ActivityMetricsService.fetchMetrics()
        

  3. To collect one or a subset of metrics:

      ActivityMetricsService.fetchMetric("<metric_to_fetch>")
      

    where the <metric_to_fetch> is one of the metrics defined in the Activities metrics table above.For example:

      ActivityMetricsService.fetchMetric("activities.metric.distinct.loggedin7days") ActivityMetricsService.fetchMetric("activities.metric.distinct.owners") ActivityMetricsService.fetchMetric("activities.metric.total.activities") ActivityMetricsService.fetchMetric("activities.metric.total.creators") ActivityMetricsService.fetchMetric("activities.metric.total.entries") ActivityMetricsService.fetchMetric("activities.metric.total.loggedin1day") ActivityMetricsService.fetchMetric("activities.metric.total.loggedin30days") ActivityMetricsService.fetchMetric("activities.metric.total.members")
      

  4. Use one of the following commands:

    • To write all of the metrics to a file:

        ActivityMetricsService.saveMetricToFile("<file_name>",
        <number>,"all")
        

    where you provide values for the following variables:

    • <file_name>: Full path to a text file in which to store the metric information. If the file does not exist, one is created.

    • <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:

      ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/
       activities/metrics/TotalActs.txt",40,“all”)
      

  5. To write one metric to a file:

      ActivityMetricsService.saveMetricToFile("<file_name>",
      <number>,"<metric_to_save>")
      

    where you provide values for the following variables:

    • <file_name>: Full path to a text file in which to store the metric information. If the file does not exist, one is created.

    • <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>: Metric that you want to write to the file. See the Activities metrics table above for a list of options.For example:

        ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/ activities/metrics/LoggedInThisWeek.txt",40,
         "activities.metric.distinct.loggedin7days") ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/ activities/metrics/TotOwners.txt",	40,"activities.metric.distinct.owners") ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/ activities/metrics/TotalActs.txt",40,"activities.metric.total.activities") ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/ activities/metrics/TotCreat.txt",40,"activities.metric.total.creators") ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/ activities/metrics/TotEntries.txt",40,"activities.metric.total.entries") ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/ activities/metrics/LoggedInToday.txt",40,
         "activities.metric.total.loggedin1day") ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/ activities/metrics/LoggedInThisMonth.txt",40,
         "activities.metric.total.loggedin30days") ActivityMetricsService.saveMetricToFile("C:/IBM/LotusConnections/Data/ activities/metrics/empCnt.txt",40,"activities.metric.total.members")
        

    For the activities.metric.total.members metric, for example, this command results in the following text getting added to the file:

      dates,2008-01-08 14:30:22 activities.metric.total.members,100
      

    After four calls, spaced an hour apart, the file would contain the following text:

      dates,2008-01-08 14:30:22,2008-01-08 15:30:22,2008-01-08 16:30:22,
       2008-01-08 17:30:22 activities.metric.total.members,100,103,105,109
      

  6. To write a subset of metrics to a file:

    1. Define a java.util.ArrayList object variable named fldkeys.

    2. 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("activities.metric.total.members") fldkeys.add("activities.metric.total.entries") fldkeys.add("activities.metric.distinct.owners")
        

    3. Use the following command to write the subset of metrics to a file:

        ActivityMetricsService.saveMetricsToFile("C:/ibm/LotusConnections/
         Data/activities/metrics/MetList.txt",40,fldkeys)
        


Monitor statistics and metrics

Collect metrics

 

Related tasks

Import statistics and metrics into a spreadsheet

Start wsadmin


+

Search Tips   |   Advanced Search