resetSnapshot()

    重置快照。主要针对一些统计信息,比如TotalDataRead、TotalDataWrite等。它的作用是清空之前的统计,重新开始统计。

    • options 格式

    属性名描述默认值格式Type指定重置的。取值:"sessions""sessions current""database""health""collections""all""all"Type: "sessions"SessionID指定重置的会话ID。所有会话SessionID: 1CollectionSpace指定需要重置快照统计信息的集合空间名称,字符串类型。空CollectionSpace : "foo"Collection指定需要重置快照统计信息的集合名称,字符串类型。需要为集合全名。空Collection : "foo.bar"Location Elements命令位置参数所有节点GroupName:"db1"

    快照类型重置项"TotalDataRead","TotalIndexRead","TotalDataWrite","TotalIndexWrite""WriteTimeSpent","ResetTimestamp","LastOpType","LastOpBegin""TotalRead","TotalReadTime","TotalWriteTime","ReadTimeSpent""LastOpEnd","LastOpInfo","ReadTimeSpent","WriteTimeSpent""TotalUpdate","TotalDelete","TotalInsert","TotalSelect"sessions current与"sessions"重置项相同"totalDataRead","totalIndexRead","totalLobRead","TotalDataWrite""svcNetOut","totalReadTime","totalWriteTime","resetTimestamp""TotalIndexWrite","totalLobWrite","totalUpdate","totalDelete""totalInsert","totalSelect","totalRead","receiveNum""replUpdate","replInsert","replDelete","svcNetIn"health"ErrNum":{"SDB_OOM","SDB_NOSPC","SDB_TOO_MANY_OPEN_FD"}"TotalDataRead","TotalIndexRead","TotalDataWrite","TotalIndexWrite""TotalUpdate","TotalDelete","TotalInsert","TotalSelect""TotalRead","TotalWrite","TotalTbScan","TotalIxScan""ResetTimestamp"all除了重置上述所有的项,还包括:"totalTime","totalContexts"

    无返回值,出错抛异常,并输出错误信息。可以通过 getLastErrObj() 或 获取错误信息 或 通过 getLastError() 获取错误码。

    • 重置 SessionID 为22的快照。

    重置前:

    重置快照: