Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetBlobStoreStats ¶
func SetBlobStoreStats(s BlobStats)
func SetElasticSearchSyncing ¶ added in v5.6.1
func SetElasticSearchSyncing(inProgress bool)
SetElasticSearchSyncing sets the charmstore_elastic_search_syncing gauge to 1 if inProgress, 0 otherwise (as per common practice for tracking "booleans" in ElasticSearch).
Types ¶
type BlobStats ¶
type BlobStats struct { // Count holds the total number of blobs stored. Count int // MaxSize holds the size of the largest blob. MaxSize int64 // MeanSize holds the average blob size. MeanSize int64 }
BlobStats holds statistics about blobs in the blob store.
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
Duration represents a time duration to be montored. The duration starts when the Duration is created and finishes when Done is called.
func NewBlobstoreGCDuration ¶
func NewBlobstoreGCDuration() *Duration
NewBlobstoreGCDuration returns a new Duration to be used for measuring the time taken to run the blobstore garbage collector.
func NewUploadProcessingDuration ¶
func NewUploadProcessingDuration() *Duration
NewUploadProcessingDuration returns a new Duration to be used for measuring the time taken to process an upload.
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request represents a monitoring request. To record a request, either create a new request with NewRequest or call Reset on an existing Request; then call Done when the request has completed.
func NewRequest ¶
NewRequest returns a new monitoring request for monitoring a request within the given root. When the request is done, Done should be called.
func (*Request) Done ¶
Done records that the request is complete, and records any metrics for the request since the last call to Reset.
type ResponseWriter ¶ added in v5.6.1
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriter wraps the http.ResponseWriter to give us the ability to retrieve the HTTP status code at any point after the response has been written.
Note: This is does not implement any of the optional methods implemented by ResponseWriters. (i.e. CloseNotifier, Flusher, Hijacker)
func NewResponseWriter ¶ added in v5.6.1
func NewResponseWriter(w http.ResponseWriter) *ResponseWriter
NewResponseWriter creates a new *ResponseWriter from a provided http.ResponseWriter
func (*ResponseWriter) Status ¶ added in v5.6.1
func (w *ResponseWriter) Status() int
Status returns the status of the ResponseWriter. It will be 0 if not set yet.
func (*ResponseWriter) Write ¶ added in v5.6.1
func (w *ResponseWriter) Write(b []byte) (int, error)
Write records the HTTP status before calling Write on the underlying http.ResponseWriter. If the status has not been set by this point, it is set to 200 OK (something the underlying http.ResponseWriter will do anyway).
func (*ResponseWriter) WriteHeader ¶ added in v5.6.1
func (w *ResponseWriter) WriteHeader(status int)
WriteHeader records the HTTP status before calling WriteHeader on the underlying http.ResponseWriter.