WCTStatistics Class Reference

Inherits from NSObject
Declared in WCTStatistics.h

Overview

Statistics

Other Methods

+ SetGlobalErrorReport:

You can register a reporter to monitor all errors.

 [WCTStatistics SetGlobalErrorReport:^(WCTError* error) {
    NSLog(@"%@", error);
 }];
+ (void)SetGlobalErrorReport:(WCTErrorReport)report

Parameters

report

report

See Also

Declared In

WCTStatistics.h

+ SetGlobalPerformanceTrace:

You can register a tracer to monitor the performance of all SQLs. It returns 1. The collection of SQLs and the executions count of each SQL. 2. Time consuming in nanoseconds. 3. Tag of database. Note that: 1. You should register trace before all db operations. 2. Global tracer will be recovered by db tracer.

[WCTStatistics SetGlobalPerformanceTrace:^(WCTTag tag, NSDictionary<NSString*, NSNumber*>* sqls, NSInteger cost) {
    NSLog(@"Tag: %d", tag);
    [sqls enumerateKeysAndObjectsUsingBlock:^(NSString *sql, NSNumber *count, BOOL *) {
        NSLog(@"SQL: %@ Count: %d", sql, count.intValue);
    }];
    NSLog(@"Total cost %ld nanoseconds", (long)cost);
}];
+ (void)SetGlobalPerformanceTrace:(WCTPerformanceTrace)trace

Parameters

trace

trace

Discussion

Warning: Tracer may cause wcdb performance degradation, according to your needs to choose whether to open.

Declared In

WCTStatistics.h

+ SetGlobalSQLTrace:

You can register a tracer to monitor the execution of all SQLs. It returns a prepared or executed SQL. Note that you should register trace before all db operations.

[WCTStatistics SetGlobalSQLTrace:^(NSString* sql) {
    NSLog(@"SQL: %@", sql);
}];
+ (void)SetGlobalSQLTrace:(WCTSQLTrace)trace

Parameters

trace

trace

Discussion

Warning: Tracer may cause wcdb performance degradation, according to your needs to choose whether to open.

See Also

Declared In

WCTStatistics.h

Compatible Methods

+ SetGlobalTrace:

+ (void)SetGlobalTrace:(WCTTrace)trace

Parameters

trace

trace

Declared In

WCTStatistics+Compatible.h