Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

implement testDatasource function #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dist/core/datasource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export declare class KairosDBDatasource {
private templatingUtils;
constructor(instanceSettings: any, $q: any, backendSrv: any, templateSrv: any);
initialize(): void;
testDatasource(): any;
query(options: any): any;
getMetricTags(metricNameTemplate: any, filters?: {}): any;
metricFindQuery(query: string): Promise<{
Expand Down
4 changes: 4 additions & 0 deletions dist/core/datasource.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/core/datasource.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions dist/core/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export class KairosDBDatasource {
() => this.initializationError = true);
}

public testDatasource() {
return this.executeRequest(this.getRequestBuilder().buildHealthStatusQuery())
.then((response) => response.status);
}

public query(options) {
const enabledTargets = _.cloneDeep(options.targets.filter((target) => !target.hide));
const convertedTargets = _.map(enabledTargets, (target) => {
Expand Down
1 change: 1 addition & 0 deletions dist/core/request/query_builder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export declare class KairosDBQueryBuilder {
private templatingUtils;
private samplingParameterConverter;
constructor(withCredentials: boolean, url: string, apiPath: string, templateSrv: any, scopedVars: any);
buildHealthStatusQuery(): any;
buildMetricNameQuery(): any;
buildMetricTagsQuery(metricName: string, filters?: {}): any;
buildDatapointsQuery(targets: any, options: any): any;
Expand Down
6 changes: 6 additions & 0 deletions dist/core/request/query_builder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading