Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5f14d62c
Unverified
Commit
5f14d62c
authored
Jan 20, 2020
by
Ryan McKinley
Committed by
GitHub
Jan 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TestData: allow negative values for random_walk parameters (#21627)
parent
2021a2df
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
pkg/tsdb/testdatasource/scenarios.go
+7
-4
public/app/plugins/datasource/testdata/partials/query.editor.html
+0
-3
No files found.
pkg/tsdb/testdatasource/scenarios.go
View file @
5f14d62c
...
@@ -542,8 +542,11 @@ func getRandomWalk(query *tsdb.Query, tsdbQuery *tsdb.TsdbQuery, index int) *tsd
...
@@ -542,8 +542,11 @@ func getRandomWalk(query *tsdb.Query, tsdbQuery *tsdb.TsdbQuery, index int) *tsd
startValue
:=
query
.
Model
.
Get
(
"startValue"
)
.
MustFloat64
(
rand
.
Float64
()
*
100
)
startValue
:=
query
.
Model
.
Get
(
"startValue"
)
.
MustFloat64
(
rand
.
Float64
()
*
100
)
spread
:=
query
.
Model
.
Get
(
"spread"
)
.
MustFloat64
(
1
)
spread
:=
query
.
Model
.
Get
(
"spread"
)
.
MustFloat64
(
1
)
noise
:=
query
.
Model
.
Get
(
"noise"
)
.
MustFloat64
(
0
)
noise
:=
query
.
Model
.
Get
(
"noise"
)
.
MustFloat64
(
0
)
min
,
hasMin
:=
query
.
Model
.
Get
(
"min"
)
.
Float64
()
max
,
hasMax
:=
query
.
Model
.
Get
(
"max"
)
.
Float64
()
min
,
err
:=
query
.
Model
.
Get
(
"min"
)
.
Float64
()
hasMin
:=
err
==
nil
max
,
err
:=
query
.
Model
.
Get
(
"max"
)
.
Float64
()
hasMax
:=
err
==
nil
points
:=
make
(
tsdb
.
TimeSeriesPoints
,
0
)
points
:=
make
(
tsdb
.
TimeSeriesPoints
,
0
)
walker
:=
startValue
walker
:=
startValue
...
@@ -551,12 +554,12 @@ func getRandomWalk(query *tsdb.Query, tsdbQuery *tsdb.TsdbQuery, index int) *tsd
...
@@ -551,12 +554,12 @@ func getRandomWalk(query *tsdb.Query, tsdbQuery *tsdb.TsdbQuery, index int) *tsd
for
i
:=
int64
(
0
);
i
<
10000
&&
timeWalkerMs
<
to
;
i
++
{
for
i
:=
int64
(
0
);
i
<
10000
&&
timeWalkerMs
<
to
;
i
++
{
nextValue
:=
walker
+
(
rand
.
Float64
()
*
noise
)
nextValue
:=
walker
+
(
rand
.
Float64
()
*
noise
)
if
hasMin
==
nil
&&
nextValue
<
min
{
if
hasMin
&&
nextValue
<
min
{
nextValue
=
min
nextValue
=
min
walker
=
min
walker
=
min
}
}
if
hasMax
==
nil
&&
nextValue
>
max
{
if
hasMax
&&
nextValue
>
max
{
nextValue
=
max
nextValue
=
max
walker
=
max
walker
=
max
}
}
...
...
public/app/plugins/datasource/testdata/partials/query.editor.html
View file @
5f14d62c
...
@@ -65,7 +65,6 @@
...
@@ -65,7 +65,6 @@
class=
"gf-form-input width-6"
class=
"gf-form-input width-6"
placeholder=
"auto"
placeholder=
"auto"
ng-model=
"ctrl.target.startValue"
ng-model=
"ctrl.target.startValue"
min=
"1"
step=
"1"
step=
"1"
ng-change=
"ctrl.refresh()"
/>
ng-change=
"ctrl.refresh()"
/>
</div>
</div>
...
@@ -95,7 +94,6 @@
...
@@ -95,7 +94,6 @@
class=
"gf-form-input width-6"
class=
"gf-form-input width-6"
placeholder=
"none"
placeholder=
"none"
ng-model=
"ctrl.target.min"
ng-model=
"ctrl.target.min"
min=
"0"
step=
"0.1"
step=
"0.1"
ng-change=
"ctrl.refresh()"
/>
ng-change=
"ctrl.refresh()"
/>
</div>
</div>
...
@@ -105,7 +103,6 @@
...
@@ -105,7 +103,6 @@
class=
"gf-form-input width-6"
class=
"gf-form-input width-6"
placeholder=
"none"
placeholder=
"none"
ng-model=
"ctrl.target.max"
ng-model=
"ctrl.target.max"
min=
"0"
step=
"0.1"
step=
"0.1"
ng-change=
"ctrl.refresh()"
/>
ng-change=
"ctrl.refresh()"
/>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment