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
1194da0d
Commit
1194da0d
authored
Oct 31, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: remove not used func. wrap query in exception
parent
3af1d74c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
41 deletions
+23
-41
public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts
+23
-41
No files found.
public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts
View file @
1194da0d
...
...
@@ -13,24 +13,29 @@ export default class StackdriverMetricFindQuery {
constructor
(
private
datasource
)
{}
async
query
(
query
:
any
)
{
switch
(
query
.
type
)
{
case
MetricFindQueryTypes
.
Services
:
return
this
.
handleServiceQuery
();
case
MetricFindQueryTypes
.
MetricTypes
:
return
this
.
handleMetricTypesQuery
(
query
);
case
MetricFindQueryTypes
.
MetricLabels
:
case
MetricFindQueryTypes
.
ResourceLabels
:
return
this
.
handleLabelQuery
(
query
);
case
MetricFindQueryTypes
.
ResourceTypes
:
return
this
.
handleResourceTypeQuery
(
query
);
case
MetricFindQueryTypes
.
Alignerns
:
return
this
.
handleAlignersQuery
(
query
);
case
MetricFindQueryTypes
.
AlignmentPeriods
:
return
this
.
handleAlignmentPeriodQuery
();
case
MetricFindQueryTypes
.
Aggregations
:
return
this
.
handleAggregationQuery
(
query
);
default
:
return
[];
try
{
switch
(
query
.
type
)
{
case
MetricFindQueryTypes
.
Services
:
return
this
.
handleServiceQuery
();
case
MetricFindQueryTypes
.
MetricTypes
:
return
this
.
handleMetricTypesQuery
(
query
);
case
MetricFindQueryTypes
.
MetricLabels
:
case
MetricFindQueryTypes
.
ResourceLabels
:
return
this
.
handleLabelQuery
(
query
);
case
MetricFindQueryTypes
.
ResourceTypes
:
return
this
.
handleResourceTypeQuery
(
query
);
case
MetricFindQueryTypes
.
Alignerns
:
return
this
.
handleAlignersQuery
(
query
);
case
MetricFindQueryTypes
.
AlignmentPeriods
:
return
this
.
handleAlignmentPeriodQuery
();
case
MetricFindQueryTypes
.
Aggregations
:
return
this
.
handleAggregationQuery
(
query
);
default
:
return
[];
}
}
catch
(
error
)
{
console
.
error
(
`Could not run StackdriverMetricFindQuery
${
query
}
`
,
error
);
return
[];
}
}
...
...
@@ -60,7 +65,6 @@ export default class StackdriverMetricFindQuery {
if
(
!
metricType
)
{
return
[];
}
// const key = this.getLabelKey({ type });
const
refId
=
'handleLabelsQueryType'
;
const
response
=
await
this
.
datasource
.
getLabels
(
metricType
,
refId
);
if
(
!
has
(
response
,
`meta.
${
type
}
.
${
labelKey
}
`
))
{
...
...
@@ -107,26 +111,4 @@ export default class StackdriverMetricFindQuery {
toFindQueryResult
(
x
)
{
return
isString
(
x
)
?
{
text
:
x
,
expandable
:
true
}
:
{
...
x
,
expandable
:
true
};
}
getLabelKey
({
type
,
metricLabelKey
,
resourceLabelKey
})
{
// switch (type) {
// case MetricFindQueryTypes.MetricLabels:
// return metricLabelKey;
// break;
// case MetricFindQueryTypes.ResourceLabels:
// return resourceLabelKey;
// default:
// return '';
// }
// }
switch
(
type
)
{
case
MetricFindQueryTypes
.
MetricLabels
:
return
'metricLabels'
;
break
;
case
MetricFindQueryTypes
.
ResourceLabels
:
return
'resourceLabels'
;
default
:
return
''
;
}
}
}
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