@ -374,12 +374,12 @@ func TestMSSQL(t *testing.T) {
_ , err = sess . InsertMulti ( series )
_ , err = sess . InsertMulti ( series )
So ( err , ShouldBeNil )
So ( err , ShouldBeNil )
Convey ( "When doing a metric query using epoch (int64) as time column should return metric with time in milliseconds" , func ( ) {
Convey ( "When doing a metric query using epoch (int64) as time column and value column (int64) should return metric with time in milliseconds" , func ( ) {
query := & tsdb . TsdbQuery {
query := & tsdb . TsdbQuery {
Queries : [ ] * tsdb . Query {
Queries : [ ] * tsdb . Query {
{
{
Model : simplejson . NewFromAny ( map [ string ] interface { } {
Model : simplejson . NewFromAny ( map [ string ] interface { } {
"rawSql" : ` SELECT TOP 1 timeInt64 as time, valueOne FROM metric_values ORDER BY time ` ,
"rawSql" : ` SELECT TOP 1 timeInt64 as time, timeInt64 FROM metric_values ORDER BY time ` ,
"format" : "time_series" ,
"format" : "time_series" ,
} ) ,
} ) ,
RefId : "A" ,
RefId : "A" ,
@ -396,12 +396,12 @@ func TestMSSQL(t *testing.T) {
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
} )
} )
Convey ( "When doing a metric query using epoch (int64 nullable) as time column should return metric with time in milliseconds" , func ( ) {
Convey ( "When doing a metric query using epoch (int64 nullable) as time column and value column (int64 nullable) should return metric with time in milliseconds" , func ( ) {
query := & tsdb . TsdbQuery {
query := & tsdb . TsdbQuery {
Queries : [ ] * tsdb . Query {
Queries : [ ] * tsdb . Query {
{
{
Model : simplejson . NewFromAny ( map [ string ] interface { } {
Model : simplejson . NewFromAny ( map [ string ] interface { } {
"rawSql" : ` SELECT TOP 1 timeInt64Nullable as time, valueOn e FROM metric_values ORDER BY time ` ,
"rawSql" : ` SELECT TOP 1 timeInt64Nullable as time, timeInt64Nullabl e FROM metric_values ORDER BY time ` ,
"format" : "time_series" ,
"format" : "time_series" ,
} ) ,
} ) ,
RefId : "A" ,
RefId : "A" ,
@ -418,12 +418,12 @@ func TestMSSQL(t *testing.T) {
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
} )
} )
Convey ( "When doing a metric query using epoch (float64) as time column should return metric with time in milliseconds" , func ( ) {
Convey ( "When doing a metric query using epoch (float64) as time column and value column (float64) should return metric with time in milliseconds" , func ( ) {
query := & tsdb . TsdbQuery {
query := & tsdb . TsdbQuery {
Queries : [ ] * tsdb . Query {
Queries : [ ] * tsdb . Query {
{
{
Model : simplejson . NewFromAny ( map [ string ] interface { } {
Model : simplejson . NewFromAny ( map [ string ] interface { } {
"rawSql" : ` SELECT TOP 1 timeFloat64 as time, valueOne FROM metric_values ORDER BY time ` ,
"rawSql" : ` SELECT TOP 1 timeFloat64 as time, timeFloat64 FROM metric_values ORDER BY time ` ,
"format" : "time_series" ,
"format" : "time_series" ,
} ) ,
} ) ,
RefId : "A" ,
RefId : "A" ,
@ -440,12 +440,12 @@ func TestMSSQL(t *testing.T) {
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
} )
} )
Convey ( "When doing a metric query using epoch (float64 nullable) as time column should return metric with time in milliseconds" , func ( ) {
Convey ( "When doing a metric query using epoch (float64 nullable) as time column and value column (float64 nullable) should return metric with time in milliseconds" , func ( ) {
query := & tsdb . TsdbQuery {
query := & tsdb . TsdbQuery {
Queries : [ ] * tsdb . Query {
Queries : [ ] * tsdb . Query {
{
{
Model : simplejson . NewFromAny ( map [ string ] interface { } {
Model : simplejson . NewFromAny ( map [ string ] interface { } {
"rawSql" : ` SELECT TOP 1 timeFloat64Nullable as time, valueOn e FROM metric_values ORDER BY time ` ,
"rawSql" : ` SELECT TOP 1 timeFloat64Nullable as time, timeFloat64Nullabl e FROM metric_values ORDER BY time ` ,
"format" : "time_series" ,
"format" : "time_series" ,
} ) ,
} ) ,
RefId : "A" ,
RefId : "A" ,
@ -462,12 +462,12 @@ func TestMSSQL(t *testing.T) {
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
} )
} )
Convey ( "When doing a metric query using epoch (int32) as time column should return metric with time in milliseconds" , func ( ) {
Convey ( "When doing a metric query using epoch (int32) as time column and value column (int32) should return metric with time in milliseconds" , func ( ) {
query := & tsdb . TsdbQuery {
query := & tsdb . TsdbQuery {
Queries : [ ] * tsdb . Query {
Queries : [ ] * tsdb . Query {
{
{
Model : simplejson . NewFromAny ( map [ string ] interface { } {
Model : simplejson . NewFromAny ( map [ string ] interface { } {
"rawSql" : ` SELECT TOP 1 timeInt32 as time, valueOne FROM metric_values ORDER BY time ` ,
"rawSql" : ` SELECT TOP 1 timeInt32 as time, timeInt32 FROM metric_values ORDER BY time ` ,
"format" : "time_series" ,
"format" : "time_series" ,
} ) ,
} ) ,
RefId : "A" ,
RefId : "A" ,
@ -484,12 +484,12 @@ func TestMSSQL(t *testing.T) {
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
} )
} )
Convey ( "When doing a metric query using epoch (int32 nullable) as time column should return metric with time in milliseconds" , func ( ) {
Convey ( "When doing a metric query using epoch (int32 nullable) as time column and value column (int32 nullable) should return metric with time in milliseconds" , func ( ) {
query := & tsdb . TsdbQuery {
query := & tsdb . TsdbQuery {
Queries : [ ] * tsdb . Query {
Queries : [ ] * tsdb . Query {
{
{
Model : simplejson . NewFromAny ( map [ string ] interface { } {
Model : simplejson . NewFromAny ( map [ string ] interface { } {
"rawSql" : ` SELECT TOP 1 timeInt32Nullable as time, valueOn e FROM metric_values ORDER BY time ` ,
"rawSql" : ` SELECT TOP 1 timeInt32Nullable as time, timeInt32Nullabl e FROM metric_values ORDER BY time ` ,
"format" : "time_series" ,
"format" : "time_series" ,
} ) ,
} ) ,
RefId : "A" ,
RefId : "A" ,
@ -506,12 +506,12 @@ func TestMSSQL(t *testing.T) {
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( tInitial . UnixNano ( ) / 1e6 ) )
} )
} )
Convey ( "When doing a metric query using epoch (float32) as time column should return metric with time in milliseconds" , func ( ) {
Convey ( "When doing a metric query using epoch (float32) as time column and value column (float32) should return metric with time in milliseconds" , func ( ) {
query := & tsdb . TsdbQuery {
query := & tsdb . TsdbQuery {
Queries : [ ] * tsdb . Query {
Queries : [ ] * tsdb . Query {
{
{
Model : simplejson . NewFromAny ( map [ string ] interface { } {
Model : simplejson . NewFromAny ( map [ string ] interface { } {
"rawSql" : ` SELECT TOP 1 timeFloat32 as time, valueOne FROM metric_values ORDER BY time ` ,
"rawSql" : ` SELECT TOP 1 timeFloat32 as time, timeFloat32 FROM metric_values ORDER BY time ` ,
"format" : "time_series" ,
"format" : "time_series" ,
} ) ,
} ) ,
RefId : "A" ,
RefId : "A" ,
@ -528,12 +528,12 @@ func TestMSSQL(t *testing.T) {
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( float64 ( float32 ( tInitial . Unix ( ) ) ) ) * 1e3 )
So ( queryResult . Series [ 0 ] . Points [ 0 ] [ 1 ] . Float64 , ShouldEqual , float64 ( float64 ( float32 ( tInitial . Unix ( ) ) ) ) * 1e3 )
} )
} )
Convey ( "When doing a metric query using epoch (float32 nullable) as time column should return metric with time in milliseconds" , func ( ) {
Convey ( "When doing a metric query using epoch (float32 nullable) as time column and value column (float32 nullable) should return metric with time in milliseconds" , func ( ) {
query := & tsdb . TsdbQuery {
query := & tsdb . TsdbQuery {
Queries : [ ] * tsdb . Query {
Queries : [ ] * tsdb . Query {
{
{
Model : simplejson . NewFromAny ( map [ string ] interface { } {
Model : simplejson . NewFromAny ( map [ string ] interface { } {
"rawSql" : ` SELECT TOP 1 timeFloat32Nullable as time, valueOn e FROM metric_values ORDER BY time ` ,
"rawSql" : ` SELECT TOP 1 timeFloat32Nullable as time, timeFloat32Nullabl e FROM metric_values ORDER BY time ` ,
"format" : "time_series" ,
"format" : "time_series" ,
} ) ,
} ) ,
RefId : "A" ,
RefId : "A" ,