github.com/newrelic/newrelic-client-go@v1.1.0/pkg/plugins/plugins_types.go (about)

     1  package plugins
     2  
     3  import "time"
     4  
     5  // Component represents information about a New Relic Plugins component.
     6  type Component struct {
     7  	ID             int             `json:"id"`
     8  	Name           string          `json:"name,omitempty"`
     9  	HealthStatus   string          `json:"health_status,omitempty"`
    10  	SummaryMetrics []SummaryMetric `json:"summary_metrics"`
    11  }
    12  
    13  // ComponentMetric represents metric information for a specific component.
    14  type ComponentMetric struct {
    15  	Name   string   `json:"name,omitempty"`
    16  	Values []string `json:"values"`
    17  }
    18  
    19  // SummaryMetric represents summary information for a specific metric.
    20  type SummaryMetric struct {
    21  	ID            int             `json:"id"`
    22  	Name          string          `json:"name"`
    23  	Metric        string          `json:"metric"`
    24  	ValueFunction string          `json:"value_function"`
    25  	Thresholds    MetricThreshold `json:"thresholds"`
    26  	Values        MetricValue     `json:"values"`
    27  }
    28  
    29  // MetricThreshold represents a threshold value for a metric.
    30  type MetricThreshold struct {
    31  	Caution  float64 `json:"caution"`
    32  	Critical float64 `json:"critical"`
    33  }
    34  
    35  // MetricValue represents the observed value of a metric.
    36  type MetricValue struct {
    37  	Raw       float64 `json:"raw"`
    38  	Formatted string  `json:"formatted"`
    39  }
    40  
    41  // Metric represents data for a specific metric.
    42  type Metric struct {
    43  	Name       string            `json:"name"`
    44  	Timeslices []MetricTimeslice `json:"timeslices"`
    45  }
    46  
    47  // MetricTimeslice represents the values of a metric over a given time.
    48  type MetricTimeslice struct {
    49  	From   *time.Time         `json:"from,omitempty"`
    50  	To     *time.Time         `json:"to,omitempty"`
    51  	Values map[string]float64 `json:"values,omitempty"`
    52  }
    53  
    54  // Plugin represents information about a New Relic plugin.
    55  type Plugin struct {
    56  	ID                  int             `json:"id"`
    57  	Name                string          `json:"name,omitempty"`
    58  	GUID                string          `json:"guid,omitempty"`
    59  	Publisher           string          `json:"publisher,omitempty"`
    60  	ComponentAgentCount int             `json:"component_agent_count"`
    61  	Details             PluginDetails   `json:"details"`
    62  	SummaryMetrics      []SummaryMetric `json:"summary_metrics"`
    63  }
    64  
    65  // PluginDetails represents information about a New Relic plugin.
    66  type PluginDetails struct {
    67  	Description           string `json:"description"`
    68  	CreatedAt             string `json:"created_at,omitempty"`
    69  	UpdatedAt             string `json:"updated_at,omitempty"`
    70  	LastPublishedAt       string `json:"last_published_at,omitempty"`
    71  	BrandingImageURL      string `json:"branding_image_url"`
    72  	UpgradedAt            string `json:"upgraded_at,omitempty"`
    73  	ShortName             string `json:"short_name"`
    74  	PublisherAboutURL     string `json:"publisher_about_url"`
    75  	PublisherSupportURL   string `json:"publisher_support_url"`
    76  	DownloadURL           string `json:"download_url"`
    77  	FirstEditedAt         string `json:"first_edited_at,omitempty"`
    78  	LastEditedAt          string `json:"last_edited_at,omitempty"`
    79  	FirstPublishedAt      string `json:"first_published_at,omitempty"`
    80  	PublishedVersion      string `json:"published_version"`
    81  	HasUnpublishedChanges bool   `json:"has_unpublished_changes"`
    82  	IsPublic              bool   `json:"is_public"`
    83  }