镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
bitlyPublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

21 watching

Forks

Latest commit

 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tsplot

Go Report Card Go Reference

Authentication

This package makes no effort to assist in authentication to the Google APIs. Instead, it will expect the caller to supply an authenticated client.

More information on authentication can be found in the official Google Cloud documentation.

func main() {

... snip ...

    start := time.Now().Add(-1 * time.Hour)
    end := time.Now()
    
    // create new request
    request := monitoringpb.ListTimeSeriesRequest{
	Name:   fmt.Sprintf("projects/%s", project),
	Filter: query,
	Interval: &monitoringpb.TimeInterval{
	    EndTime:   timestamppb.New(et),
	    StartTime: timestamppb.New(st),
	},
	Aggregation:          nil,
	SecondaryAggregation: nil,
	View:                 monitoringpb.ListTimeSeriesRequest_FULL,
    }
    
    // execute the request and get the response from Google APIs
    tsi := GoogleCloudMonitoringClient.ListTimeSeries(context.Background(), request)
    
    // Create the plot from the GAPI TimeSeries
    plot, _ := tsplot.NewPlotFromTimeSeriesIterator(tsi, "", nil)
    
    // Save the new plot to disk.
    plot.Save(8*vg.Inch, 4*vg.Inch, "my_plot.png")
}

Example generated graphs:

Query across multiple time series with mean reducer:
graph1

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

21 watching

Forks

Releases

Packages

Used by

Contributors

Languages