Contents Index synchronization_statistics table event time_statistics table event

MobiLink Synchronization Reference
  Synchronization Events

time_statistics connection event


Function 

Tracks time statistics by user and event.

Parameters 

In the following table, the description provides the SQL data type. If you are writing your script in Java or .NET, you should use the appropriate corresponding data type. See SQL-Java data types and SQL-.NET data types.

Event parameters are optional only if no subsequent parameters are specified. For example, you must use parameter 1 if you want to use parameter 2.

Item Parameter Description
1 ml_username VARCHAR(128)
2 event_name VARCHAR(128)
3 num_calls INTEGER
4 min_time INTEGER. Milliseconds.
5 max_time INTEGER. Milliseconds.
6 total_time INTEGER. Milliseconds.
Default action 

None.

Description 

The time_statistics event allows you to gather time statistics for any user during synchronization. The statistics are gathered only for those events for which there is a corresponding script. The script gathers aggregate data for occasions where a single event occurs multiple times. The script can be especially useful for time comparisons across users, events and tables.

See also 

time_statistics table event

download_statistics connection event

download_statistics table event

upload_statistics connection event

upload_statistics table event

synchronization_statistics connection event

synchronization_statistics table event

MobiLink Monitor

SQL example 

The following example comes from an Oracle installation.

INSERT INTO time_statistics (id, ml_user, table,
     event_name, num_calls, min_time, max_time, total_time)
   VALUES (ts_id.nextval,?,?,?,?,?,?)
Java example 

The following stored procedure call registers a Java method called timeStatisticsConnection as the script for the time_statistics connection event when synchronizing the script version ver1. This syntax is for Adaptive Server Anywhere consolidated databases.

call ml_add_java_connection_script(
  'ver1',
  'time_statistics',
  'ExamplePackage.ExampleClass.timeStatisticsConnection' )

Following is the sample Java method timeStatisticsConnection. It prints statistics for the prepare_for_download event.

public void timeStatisticsConnection(
  String ml_username,
  String table_name,
  String event_name,
int num_calls, int min_time, int max_time,
int total_time )
{  if( event_name.equals( "prepare_for_download")
   {  java.lang.System.out.println(
      "prepare_for_download num_calls: " + num_calls +
      "total_time: " + total_time ); } }
.NET example 

The following stored procedure call registers a .NET method called TimeStats as the script for the time_statistics connection event when synchronizing the script version ver1. This syntax is for Adaptive Server Anywhere consolidated databases.

call ml_add_dnet_connection_script(
  'ver1',
  'time_statistics',
  'TestScripts.Test.TimeStats'
)

Following is the C# signature for the call TimeStats.

public void TimeStats(
  string user,
  string eventName,
  int numCalls,
  int minTime,
  int maxTime,
  int totTime )

Contents Index synchronization_statistics table event time_statistics table event