MobiLink Synchronization Reference
Synchronization Events
Tracks time statistics.
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 | table | VARCHAR(128) |
3 | event_name | VARCHAR(128) |
4 | num_calls | INTEGER |
5 | min_time | INTEGER. Milliseconds. |
6 | max_time | INTEGER. Milliseconds. |
7 | total_time | INTEGER. Milliseconds. |
None.
The time_statistics table event allows you to gather time statistics for any user and table 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.
time_statistics connection event
download_statistics connection event
download_statistics table event
upload_statistics connection event
synchronization_statistics connection event
synchronization_statistics table event
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,?,?,?,?,?,?,?)
The following stored procedure call registers a Java method called timeStatisticsTable as the script for the time_statistics table event when synchronizing the script version ver1. This syntax is for Adaptive Server Anywhere consolidated databases.
call ml_add_java_table_script( 'ver1', 'table1', 'time_statistics', 'ExamplePackage.ExampleClass.timeStatisticsTable' )
Following is the sample Java method timeStatisticsTable. It prints statistics for the upload_old_row_insert 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( "upload_old_row_insert") { java.lang.System.out.println( "upload_old_row_insert num_calls: " + num_calls + "total_time: " + total_time ); } }
The following stored procedure call registers a .NET method called TimeTableStats as the script for the time_statistics table event when synchronizing the script version ver1 and the table table1. This syntax is for Adaptive Server Anywhere consolidated databases.
call ml_add_dnet_table_script( 'ver1', 'table1', 'time_statistics', 'TestScripts.Test.TimeTableStats' )
Following is the C# signature for the call TimeTableStats.
public void TimeTableStats( string user, string table, string eventName, int numCalls, int minTime, int maxTime, int totTime )