C# Class GrafanaAdapters.AnnotationExtensions

Grafana Annotation extensions class.
Afficher le fichier Open project: GridProtectionAlliance/gsf

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat GrafanaAdapters.QueryRequest

IsApplicable() public static méthode

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.
Résultat bool

ParseQueryType() public static méthode

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.
Résultat AnnotationType

ParseSourceDefinitions() public static méthode

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.
Résultat DataRow>.Dictionary

PopulateResponse() public static méthode

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.
Résultat void

TableName() public static méthode

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

TargetFieldName() public static méthode

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.
Résultat string