com.rapidminer.tools.usagestats
Class UsageStatistics

java.lang.Object
  extended by com.rapidminer.tools.usagestats.UsageStatistics

public class UsageStatistics
extends java.lang.Object

Collects statistics about usage of operators. Statistics can be sent to a server collecting them. Counting and resetting is thread safe.

Author:
Simon Fischer
See Also:
UsageStatsTransmissionDialog

Nested Class Summary
static class UsageStatistics.StatisticsScope
          Selects with which scope the statistics are collected and reported.
 
Method Summary
 void count(Operator op, OperatorStatisticsValue type)
          Adds 1 to the statistics value for the given operator in all scopes.
 void count(Operator op, OperatorStatisticsValue type, UsageStatistics.StatisticsScope... scopes)
          Adds 1 to the statistics value for the given operator in the given scopes.
 void count(Process process, OperatorStatisticsValue type)
          Adds 1 to the statistics value for all operators contained in the current process in all scopes.
 void count(Process process, OperatorStatisticsValue type, UsageStatistics.StatisticsScope... scopes)
          Adds 1 to the statistics value for all operators contained in the current process the given scopes.
 DataTable getAsDataTable(UsageStatistics.StatisticsScope scope)
          Returns the statistics as a data table that can be displayed to the user.
static UsageStatistics getInstance()
           
 java.util.Date getNextTransmission()
          Returns the date at which the next transmission should be scheduled.
 java.util.List<java.lang.String> getOperatorKeys(UsageStatistics.StatisticsScope scope)
          Returns a list of all operator names for which statistics are available.
 OperatorUsageStatistics getOperatorStatistics(UsageStatistics.StatisticsScope scope, OperatorDescription op)
           
 java.lang.String getUserKey()
          Returns the user key for this session.
 boolean hasFailedToday()
           
static void main(java.lang.String[] args)
           
 void reset()
          Sets all current counters to 0 and sets the last reset date to the current time.
 void save()
          Saves the statistics to a user file.
 void scheduleTransmissionFromNow()
           
 boolean transferUsageStats(ProgressListener progressListener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UsageStatistics getInstance()

reset

public void reset()
Sets all current counters to 0 and sets the last reset date to the current time.


count

public void count(Process process,
                  OperatorStatisticsValue type)
Adds 1 to the statistics value for all operators contained in the current process in all scopes.


count

public void count(Process process,
                  OperatorStatisticsValue type,
                  UsageStatistics.StatisticsScope... scopes)
Adds 1 to the statistics value for all operators contained in the current process the given scopes.


count

public void count(Operator op,
                  OperatorStatisticsValue type)
Adds 1 to the statistics value for the given operator in all scopes.


count

public void count(Operator op,
                  OperatorStatisticsValue type,
                  UsageStatistics.StatisticsScope... scopes)
Adds 1 to the statistics value for the given operator in the given scopes.


getOperatorStatistics

public OperatorUsageStatistics getOperatorStatistics(UsageStatistics.StatisticsScope scope,
                                                     OperatorDescription op)

save

public void save()
Saves the statistics to a user file.


getAsDataTable

public DataTable getAsDataTable(UsageStatistics.StatisticsScope scope)
Returns the statistics as a data table that can be displayed to the user.


getOperatorKeys

public java.util.List<java.lang.String> getOperatorKeys(UsageStatistics.StatisticsScope scope)
Returns a list of all operator names for which statistics are available.


transferUsageStats

public boolean transferUsageStats(ProgressListener progressListener)
                           throws java.lang.Exception
Returns:
true on success
Throws:
java.lang.Exception

getUserKey

public java.lang.String getUserKey()
Returns the user key for this session.

Returns:
the user key

getNextTransmission

public java.util.Date getNextTransmission()
Returns the date at which the next transmission should be scheduled.


scheduleTransmissionFromNow

public void scheduleTransmissionFromNow()

hasFailedToday

public boolean hasFailedToday()

main

public static void main(java.lang.String[] args)


Copyright © 2001-2009 by Rapid-I