FieldCache class
Signature
export declare class FieldCache
Import
import { FieldCache } from '@grafana/data';
Constructors
Constructor | Modifiers | Description |
---|---|---|
constructor(data) | Constructs a new instance of the FieldCache class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
fields | FieldWithIndex[] |
Methods
Method | Modifiers | Description |
---|---|---|
getFieldByName(name) | Returns the first field with the given name. | |
getFields(type) | ||
getFieldsByLabel(label, value) | Returns the fields with the given label. | |
getFirstFieldOfType(type, includeHidden) | ||
hasFieldNamed(name) | ||
hasFieldOfType(type) | ||
hasFieldWithNameAndType(name, type) |
constructor(data)
Constructs a new instance of the FieldCache
class
Signature
constructor(data: DataFrame);
Parameters
Parameter | Type | Description |
---|---|---|
data | DataFrame |
fields property
Signature
fields: FieldWithIndex[];
getFieldByName method
Returns the first field with the given name.
Signature
getFieldByName(name: string): FieldWithIndex | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
name | string |
Returns:
FieldWithIndex | undefined
getFields method
Signature
getFields(type?: FieldType): FieldWithIndex[];
Parameters
Parameter | Type | Description |
---|---|---|
type | FieldType |
Returns:
FieldWithIndex[]
getFieldsByLabel method
Returns the fields with the given label.
Signature
getFieldsByLabel(label: string, value: string): FieldWithIndex[];
Parameters
Parameter | Type | Description |
---|---|---|
label | string |
|
value | string |
Returns:
FieldWithIndex[]
getFirstFieldOfType method
Signature
getFirstFieldOfType(type: FieldType, includeHidden?: boolean): FieldWithIndex | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
type | FieldType |
|
includeHidden | boolean |
Returns:
FieldWithIndex | undefined
hasFieldNamed method
Signature
hasFieldNamed(name: string): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
name | string |
Returns:
boolean
hasFieldOfType method
Signature
hasFieldOfType(type: FieldType): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
type | FieldType |
Returns:
boolean
hasFieldWithNameAndType method
Signature
hasFieldWithNameAndType(name: string, type: FieldType): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
name | string |
|
type | FieldType |
Returns:
boolean
Related Grafana video resources
Getting started with Grafana
Take a guided tour of Grafana and learn how to monitor a web service using Prometheus and Loki in this beginner-friendly webinar.
All about Grafana plugins: Visualizing disparate data sources in one place
Grafana Enterprise plugins are integrations with other commercial monitoring tools (such as Datadog, Splunk, New Relic, ServiceNow, Oracle, and Dynatrace) that are created, maintained, and supported by the Grafana Labs team.
Demo: Getting started with Grafana Enterprise and observability
Join the Grafana Labs team for a 30-minute demo of how to get started with the Grafana Stack, so you can go from zero to observability in just a few minutes.