C# Class GrafanaAdapters.AnnotationExtensions

Grafana Annotation extensions class.
Mostra file Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
ExtractQueryRequest ( this request, IEnumerable targets, int maxDataPoints ) : GrafanaAdapters.QueryRequest

Extracts a Grafana QueryRequest from an AnnotationRequest.

IsApplicable ( this type, double datapoint ) : bool

Determines if the data point is applicable for specified annotation type.

ParseQueryType ( this annotation, bool &useFilterExpression ) : AnnotationType

Parses query expression from annotation for annotation type.

ParseSourceDefinitions ( this annotation, AnnotationType type, DataSet source, bool useFilterExpression ) : DataRow>.Dictionary

Parses source definitions for an annotation query.

PopulateResponse ( this type, GrafanaAdapters.AnnotationResponse response, string target, DataRow definition, double datapoint, DataSet source ) : void

Populates an annotation response title, text and tags for specified annotation type.

TableName ( this type ) : string

Gets table name for specified annotation type.

TargetFieldName ( this type ) : string

Gets the target field name for Guid based point IDs for table used with specified annotation type.

Private Methods

Method Description
GetAlarmCondition ( DataRow defintion ) : string
GetMetaData ( DataSet source, string table, string expression ) : DataRow
GetTargetFromGuid ( string guidID ) : MeasurementKey
GetTargetMetaData ( DataSet source, object value ) : DataRow
KeyFromTag ( this pointTag, DataSet source ) : MeasurementKey

Looks up measurement key from point tag.

This function uses the DataTable.Select(string) function which uses a linear search algorithm that can be slow for large data sets, it is recommended that any results for calls to this function be cached to improve performance.

TagFromKey ( this key, DataSet source ) : string

Looks up point tag from measurement key value.

This function uses the DataTable.Select(string) function which uses a linear search algorithm that can be slow for large data sets, it is recommended that any results for calls to this function be cached to improve performance.

Translate ( this tableName ) : string

Method Details

ExtractQueryRequest() public static method

Extracts a Grafana QueryRequest from an AnnotationRequest.
public static ExtractQueryRequest ( this request, IEnumerable targets, int maxDataPoints ) : GrafanaAdapters.QueryRequest
request this Annotation request.
targets IEnumerable List of desired targets.
maxDataPoints int Maximum points to return.
return GrafanaAdapters.QueryRequest

IsApplicable() public static method

Determines if the data point is applicable for specified annotation type.
public static IsApplicable ( this type, double datapoint ) : bool
type this Annotation type.
datapoint double Time series values data point.
return bool

ParseQueryType() public static method

Parses query expression from annotation for annotation type.
public static ParseQueryType ( this annotation, bool &useFilterExpression ) : AnnotationType
annotation this Grafana annotation.
useFilterExpression bool Determines if query is using a filter expression.
return AnnotationType

ParseSourceDefinitions() public static method

Parses source definitions for an annotation query.
public static ParseSourceDefinitions ( this annotation, AnnotationType type, DataSet source, bool useFilterExpression ) : DataRow>.Dictionary
annotation this Grafana annotation.
type AnnotationType Annotation type.
source System.Data.DataSet Metadata of source definitions.
useFilterExpression bool Determines if query is using a filter expression.
return DataRow>.Dictionary

PopulateResponse() public static method

Populates an annotation response title, text and tags for specified annotation type.
public static PopulateResponse ( this type, GrafanaAdapters.AnnotationResponse response, string target, DataRow definition, double datapoint, DataSet source ) : void
type this Annotation type.
response GrafanaAdapters.AnnotationResponse Annotation response.
target string Target of annotation response.
definition System.Data.DataRow Associated metadata definition for response.
datapoint double Time series values data point for response.
source System.Data.DataSet Metadata of source definitions.
return void

TableName() public static method

Gets table name for specified annotation type.
public static TableName ( this type ) : string
type this Annotation type.
return string

TargetFieldName() public static method

Gets the target field name for Guid based point IDs for table used with specified annotation type.
public static TargetFieldName ( this type ) : string
type this Annotation type.
return string