Merge pull request #2071 from influxdata/feature/port-1.3.8.x-pixel

Feature/port 1.3.8.x pixel
pull/10616/head
Nathan Haugo 2017-10-04 12:52:55 -07:00 committed by GitHub
commit a2fe9fcfa9
3 changed files with 11 additions and 6 deletions

View File

@ -21,6 +21,7 @@
1. [#2040](https://github.com/influxdata/chronograf/pull/2040): Prevent the legend from overlapping graphs at the bottom of the screen
1. [#2054](https://github.com/influxdata/chronograf/pull/2054): Add a "Plus" icon to every button with an Add or Create action for clarity and consistency
1. [#2052](https://github.com/influxdata/chronograf/pull/2052): Make hovering over series smoother
1. [#2071](https://github.com/influxdata/chronograf/pull/2071): Reduce the number of pixels per cell to one point per 3 pixels
1. [#2072](https://github.com/influxdata/chronograf/pull/2072): Remove tabs from Data Explorer
1. [#2057](https://github.com/influxdata/chronograf/pull/2057): Improve appearance of placeholder text in inputs
1. [#2057](https://github.com/influxdata/chronograf/pull/2057): Add ability to use "Default" values in Source Connection form

View File

@ -283,6 +283,10 @@ func (g *GroupByVar) parseAbsolute(fragment string) (time.Duration, error) {
}
}
if len(durs) == 1 {
durs = append(durs, time.Now())
}
// reject more than 2 times found
if len(durs) != 2 {
return time.Duration(0), errors.New("must provide exactly two absolute times")
@ -294,7 +298,7 @@ func (g *GroupByVar) parseAbsolute(fragment string) (time.Duration, error) {
}
func (g *GroupByVar) String() string {
duration := g.Duration.Nanoseconds() / (g.ReportingInterval.Nanoseconds() * int64(g.Resolution))
duration := int64(g.Duration/time.Second) / int64(g.Resolution) * 3
if duration == 0 {
duration = 1
}

View File

@ -135,7 +135,7 @@ func TestTemplateReplace(t *testing.T) {
ReportingInterval: 10 * time.Second,
},
},
want: `SELECT mean(usage_idle) from "cpu" where time > now() - 4320h group by time(1555s)`,
want: `SELECT mean(usage_idle) from "cpu" where time > now() - 4320h group by time(46656s)`,
},
{
name: "auto group by without duration",
@ -148,7 +148,7 @@ func TestTemplateReplace(t *testing.T) {
ReportingInterval: 10 * time.Second,
},
},
want: `SELECT mean(usage_idle) from "cpu" WHERE time > now() - 4320h group by time(1555s)`,
want: `SELECT mean(usage_idle) from "cpu" WHERE time > now() - 4320h group by time(46656s)`,
},
{
name: "auto group by with :dashboardTime:",
@ -170,7 +170,7 @@ func TestTemplateReplace(t *testing.T) {
},
},
},
want: `SELECT mean(usage_idle) from "cpu" WHERE time > now() - 4320h group by time(1555s)`,
want: `SELECT mean(usage_idle) from "cpu" WHERE time > now() - 4320h group by time(46656s)`,
},
{
name: "auto group by failing condition",
@ -192,7 +192,7 @@ func TestTemplateReplace(t *testing.T) {
},
},
},
want: `SELECT mean(usage_idle) FROM "cpu" WHERE time > now() - 1h GROUP BY time(3s)`,
want: `SELECT mean(usage_idle) FROM "cpu" WHERE time > now() - 1h GROUP BY time(93s)`,
},
}
for _, tt := range tests {
@ -274,7 +274,7 @@ func TestGroupByVarString(t *testing.T) {
ReportingInterval: 10 * time.Second,
Duration: 24 * time.Hour,
},
want: "time(12s)",
want: "time(369s)",
},
{
name: "String() outputs a minimum of 1s intervals",