MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / getTimeFactor

Function getTimeFactor

client/utils.go:42–60  ·  view source on GitHub ↗
(openResp *rpc.TSOpenSessionResp)

Source from the content-addressed store, hash-verified

40)
41
42func getTimeFactor(openResp *rpc.TSOpenSessionResp) (int32, error) {
43 if !openResp.IsSetConfiguration() {
44 return 1_000, nil
45 }
46 precision, exists := openResp.GetConfiguration()[TIME_PRECISION]
47 if !exists {
48 return 1_000, nil
49 }
50 switch precision {
51 case MILLISECOND:
52 return 1_000, nil
53 case MICROSECOND:
54 return 1_000_000, nil
55 case NANOSECOND:
56 return 1_000_000_000, nil
57 default:
58 return 0, fmt.Errorf("unknown time precision: %v", precision)
59 }
60}
61
62func getTimePrecision(timeFactor int32) (string, error) {
63 switch timeFactor {

Callers 2

OpenMethod · 0.85
OpenClusterMethod · 0.85

Calls 2

IsSetConfigurationMethod · 0.45
GetConfigurationMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…