Commit Graph

376 Commits

Author SHA1 Message Date
Karsten Weiss
be2d635078 Simplify error returns (gosimple)
This fixes:
pkg/api/avatar/avatar.go:261:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/log/file.go:102:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/metrics/graphitebridge/graphite.go:298:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/provisioning/provisioning.go:23:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/alert_notification.go:27:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/alert_notification.go:27:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/annotation.go:105:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/annotation.go:105:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard.go:351:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard.go:435:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard_acl.go:38:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard_acl.go:38:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/stats.go:22:2: 'if err != nil { return err }; return err' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/team.go:213:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:256:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:256:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:274:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:274:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:482:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:482:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
2018-04-16 21:04:57 +02:00
Karsten Weiss
c5a09a3dc1 Remove redundant break statements (gosimple)
This fixes:
pkg/components/dynmap/dynmap.go:588:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:610:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:641:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:690:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:712:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:749:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:785:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:74:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:77:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:82:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:178:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:181:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:184:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:187:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:190:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:193:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:196:3: redundant break statement (S1023)
2018-04-16 21:04:57 +02:00
Daniel Lee
9337972a0f sqlds: fix text in comments for tests 2018-04-16 12:55:27 +02:00
Daniel Lee
ee303c03e9
Merge pull request #11550 from grafana/sql_ts_precision
sql tsdb: fix precision and data type support for time columns
2018-04-16 11:04:46 +02:00
Daniel Lee
67daa9b058
Merge pull request #11588 from mjtrangoni/fix-codespell-issues
Fix codespell issues
2018-04-16 09:12:49 +02:00
Mario Trangoni
91fb2e07ce pkg: fix codespell issues 2018-04-13 20:31:29 +02:00
Marcus Efraimsson
a86ee304ff
tsdb: remove unnecessary type casts in sql data sources macro engines 2018-04-12 19:08:35 +02:00
Marcus Efraimsson
f5586b1270
tsdb: sql data sources should handle time ranges before epoch start correctly 2018-04-12 18:53:12 +02:00
Marcus Efraimsson
6cb891dca8
mysql: use a datetime column with microsecond precision in test 2018-04-10 16:37:39 +02:00
Marcus Efraimsson
97f67ddcb8
tsdb: improved floating point support when converting sql time column to epoch (ms) 2018-04-10 16:36:00 +02:00
Marcus Efraimsson
9d84e6f31f
mssql: fix precision for time columns in time series query mode 2018-04-10 11:10:56 +02:00
Marcus Efraimsson
0317ecbf0d
postgres: support running multiple postgres integration tests
Makes it possible to run mysql integration tests for both
grafana config db and tsdb at the same time using
GRAFANA_TEST_DB=postgres go test ./pkg/...
2018-04-10 11:08:30 +02:00
Marcus Efraimsson
1783c534fd
postgres: fix precision for time columns in time series query mode 2018-04-10 11:07:01 +02:00
Marcus Efraimsson
af62646624
mysql: fix precision for time columns in time series query mode 2018-04-10 11:01:43 +02:00
Marcus Efraimsson
5c120c2c11
mysql: mysql tests should use a db server with UTC
To get rid of issues involving date/time when testing.
Also, makes it possible to run mysql integration tests for both
grafana config db and tsdb at the same time using
GRAFANA_TEST_DB=mysql go test ./pkg/...
2018-04-10 10:58:45 +02:00
Marcus Efraimsson
a314890f89
tsdb: add support for more data types when converting sql time column to epoch (ms) 2018-04-10 10:33:23 +02:00
ryan
1c9ebd5bd8 fix test 2018-04-09 14:01:09 +02:00
ryan
920a0c4fec skip mssql fix 2018-04-09 13:49:13 +02:00
ryan
7d6c8aa612 add mssql and mysql 2018-04-09 13:34:35 +02:00
ryan
113bfb3d3e don't convert to uint64 2018-04-09 13:28:32 +02:00
Carl Bergquist
980e078222
Merge pull request #11326 from bergquist/more_traces
dataproxy: adds dashboardid and panelid as tags
2018-03-23 17:13:15 +01:00
Marcus Efraimsson
f0f41c2a8e mysql: skip tests by default 2018-03-22 16:44:55 +01:00
Marcus Efraimsson
f5654f88e2 mysql: fix precision for the time column in table/annotation query mode
Use the ConvertSqlTimeColumnToEpochMs function to convert any native
datetime data type or epoch time (millisecond precision).
Refactored mysql implementation to make it more similar to postgres
and mssql implementations.
Added $__timeEpoch macro function with same implementation as $__time.
Added possibility to use a time column named time in addition to
the currectly supported time_sec.
Additional tests and update of existing.
Added test dashboard.
2018-03-22 15:40:46 +01:00
Marcus Efraimsson
66c03f84f5 postgres: fix precision for the time column in table/annotation query mode
Use the ConvertSqlTimeColumnToEpochMs function to convert any native
datetime data type or epoch time (millisecond precision).
Additional tests and update of existing due to timezone issues
running postgres on UTC and dev environment on non-utc.
Added test dashboard.
2018-03-22 15:32:33 +01:00
Marcus Efraimsson
b69ebee066 mssql: fix precision for the time column in table/annotation query mode
Use the ConvertSqlTimeColumnToEpochMs function to convert any native
datetime data type or epoch time (millisecond precision).
Additional tests and update of existing due to timezone issues
running MSSQL on UTC and dev environment on non-utc.
Update stored procedures test to handle more parameters.
Update test dashboard.
2018-03-22 15:23:12 +01:00
Marcus Efraimsson
b0076d4f65 mssql: remove UTC conversion in macro functions
Removes the macro function . Macro functions should not do UTC/timezone conversion - they should
work in the same way as postgres and mysql datasource implementations.
Grafana and Microsft SQL Server should be run on servers with UTC timezones.
2018-03-22 14:55:44 +01:00
Marcus Efraimsson
3ccadff800 mssql: fix timeGroup macro so that it properly creates correct groups
Earlier the division of interval was done using whole numbers resulting in that important information
was lost/too many time series merged to the same group. Now using division of floating point and rounding
up to solve the problem
2018-03-22 14:49:40 +01:00
bergquist
519fd8b2ba graphite: adds more traces for alerting 2018-03-21 13:16:59 +01:00
Marcus Efraimsson
3cb0bc3da1 sql datasource: extract common logic for converting time column to epoch time in ms 2018-03-21 11:20:15 +01:00
Daniel Lee
e5e9d3c2f3 mssql: adds test for time should be ms in table mode 2018-03-20 14:42:29 +01:00
Daniel Lee
ae4c6e4648 mssql: fix precision for time column in table mode
ref #11306
2018-03-20 12:59:40 +01:00
Marcus Efraimsson
192e913b7b mssql: add integration test to verify stored procedure usage 2018-03-19 19:56:34 +01:00
Marcus Efraimsson
8f6626e805 mssql: encrypt password in database 2018-03-19 17:32:51 +01:00
Marcus Efraimsson
449a307575 mssql: remove dynamic construction of metric column and other columns
This seems like a niche feature which can be solved by defining multiple queries. In the future
we'll probably add support for defining series name by alias field similar to how other datasources
have solved that, e.g. prometheus.
2018-03-19 17:14:01 +01:00
Marcus Efraimsson
d14946a135 mssql: cleanup and minor refactor 2018-03-19 13:32:04 +01:00
Marcus Efraimsson
24c0f28f41 mssql: allow host without port and fallback to default port 1433 2018-03-19 13:24:31 +01:00
Marcus Efraimsson
e97b03e930 mssql: additional integration tests
Metric query of table having multiple value columns
Annotation query
2018-03-16 14:42:54 +01:00
Marcus Efraimsson
f0f8006d8d mssql: support money, smallmoney and decimal data types 2018-03-16 14:37:16 +01:00
Marcus Efraimsson
9144701fcc mssql: disable mssql integration tests per default 2018-03-15 15:27:31 +01:00
Leonard Gram
3b03dce3c2 mssql: timeGroup fill support added. 2018-03-15 15:06:54 +01:00
Marcus Efraimsson
faf9e3f722 mssql: add timeGroup integration test 2018-03-15 14:26:53 +01:00
Leonard Gram
571556e1d8 mssql: adds fill to timeGroup macro. 2018-03-15 13:11:26 +01:00
Marcus Efraimsson
3d0f97aab9 mssql datasource: wip 2018-03-15 09:51:29 +01:00
Marcus Efraimsson
c87752102a mssql datasource: support for timeGroup macro function 2018-03-13 22:49:49 +01:00
Marcus Efraimsson
57d46a706c mssql datasource: additional data type tests 2018-03-13 19:54:29 +01:00
Marcus Efraimsson
d4beee2bb0 Merge branch 'master' into mssql_datasource 2018-03-13 16:03:02 +01:00
Carl Bergquist
a589f701ad
Merge pull request #10925 from mtanda/cw_high_resolution
(cloudwatch) support high resolution query
2018-03-08 18:06:08 +01:00
Mitsuhiro Tanda
eecbdc89eb fix, set default highResolution setting 2018-03-08 01:18:11 +09:00
bergquist
cb223ee563 removes commented code 2018-03-07 16:40:24 +01:00
Sven Klemm
4904a051cf use net/url to generate postgres connection url 2018-03-05 16:06:04 +01:00