harmonized Timing between Query/Write

This commit is contained in:
root 2016-09-08 20:30:43 -07:00
parent f5df4898a3
commit c50db56b73
2 changed files with 4 additions and 16 deletions

View File

@ -21,7 +21,7 @@ gorqlite should be considered alpha until more testers share their experiences.
* Support for several rqlite-specific operations: * Support for several rqlite-specific operations:
* `Leader()` and `Peers()` to examine the cluster. * `Leader()` and `Peers()` to examine the cluster.
* `SetConsistencyLevel()` can be called at any time on a connection to change the consistency level for future operations. * `SetConsistencyLevel()` can be called at any time on a connection to change the consistency level for future operations.
* `Timing()` can be called on a per-result basis to retrieve the timings information for executed operations as float64, per the rqlite API. * `Timing` can be referenced on a per-result basis to retrieve the timings information for executed operations as float64, per the rqlite API.
* `Trace(io.Writer)`/`Trace(nil)` can be used to turn on/off debugging information on everything gorqlite does to a io.Writer of your choice. * `Trace(io.Writer)`/`Trace(nil)` can be used to turn on/off debugging information on everything gorqlite does to a io.Writer of your choice.
* No external dependencies. Uses only standard library functions. * No external dependencies. Uses only standard library functions.

View File

@ -167,7 +167,7 @@ func (conn *Connection) Query(sqlStatements []string) (results []QueryResult, er
} }
// time is a float64 // time is a float64
thisQR.timing = thisResult["time"].(float64) thisQR.Timing = thisResult["time"].(float64)
// column & type are an array of strings // column & type are an array of strings
c := thisResult["columns"].([]interface{}) c := thisResult["columns"].([]interface{})
@ -186,7 +186,7 @@ func (conn *Connection) Query(sqlStatements []string) (results []QueryResult, er
thisQR.rowNumber = -1 thisQR.rowNumber = -1
trace("%s: this result (#col,time) %d %f",conn.ID,len(thisQR.columns),thisQR.timing) trace("%s: this result (#col,time) %d %f",conn.ID,len(thisQR.columns),thisQR.Timing)
results = append(results,thisQR) results = append(results,thisQR)
} }
@ -221,7 +221,7 @@ type QueryResult struct {
Err error Err error
columns []string columns []string
types []string types []string
timing float64 Timing float64
values []interface{} values []interface{}
rowNumber int64 rowNumber int64
} }
@ -394,15 +394,3 @@ func (qr *QueryResult) Types() []string {
return qr.types return qr.types
} }
/* *****************************************************************
method: QueryResult.Timing()
* *****************************************************************/
/*
Timing() returns this QueryResult's execution time, as reported by rqlite.
*/
func (qr *QueryResult) Timing() float64 {
return qr.timing
}