Documentation ¶
Index ¶
- Constants
- Variables
- func PingCheck()
- type Application
- type Event
- type Gclient
- type Usage
- func (u *Usage) ApplicationBuilder() *Usage
- func (u *Usage) Build() *Usage
- func (u *Usage) InstallBuilder(override bool) *Usage
- func (u *Usage) NewEvent(c, a, l string, v int64) *Usage
- func (u *Usage) Send()
- func (u *Usage) SetAction(a string) *Usage
- func (u *Usage) SetApplicationID(appID string) *Usage
- func (u *Usage) SetApplicationInstallerID(appInstallerID string) *Usage
- func (u *Usage) SetApplicationName(appName string) *Usage
- func (u *Usage) SetApplicationVersion(appVersion string) *Usage
- func (u *Usage) SetCampaignName(campaignName string) *Usage
- func (u *Usage) SetCampaignSource(campaignSrc string) *Usage
- func (u *Usage) SetCategory(c string) *Usage
- func (u *Usage) SetClientID(userID string) *Usage
- func (u *Usage) SetDataSource(dataSource string) *Usage
- func (u *Usage) SetDocumentTitle(documentTitle string) *Usage
- func (u *Usage) SetLabel(l string) *Usage
- func (u *Usage) SetReplicaCount(count, method string) *Usage
- func (u *Usage) SetTrackingID(track string) *Usage
- func (u *Usage) SetValue(v int64) *Usage
- func (u *Usage) SetVolumeCapacity(volCapG string) *Usage
- func (u *Usage) SetVolumeType(volType, method string) *Usage
- type VersionSet
Constants ¶
const ( // GAclientID is the unique code of OpenEBS project in Google Analytics GAclientID string = "UA-127388617-1" // InstallEvent event is sent on pod starts InstallEvent string = "install" // Ping event is sent periodically Ping string = "zfs-ping" // VolumeProvision event is sent when a volume is created VolumeProvision string = "volume-provision" // VolumeDeprovision event is sent when a volume is deleted VolumeDeprovision string = "volume-deprovision" // AppName the application name AppName string = "OpenEBS" // RunningStatus status is running RunningStatus string = "running" // EventLabelNode holds the string label "nodes" EventLabelNode string = "nodes" // EventLabelCapacity holds the string label "capacity" EventLabelCapacity string = "capacity" // Replica Event replication Replica string = "replica:" // DefaultReplicaCount holds the replica count string DefaultReplicaCount string = "replica:1" // DefaultCASType Event application name constant for volume event DefaultCASType string = "zfs-localpv" // LocalPVReplicaCount is the constant used by usage to represent // replication factor in LocalPV LocalPVReplicaCount string = "1" )
Variables ¶
var OpenEBSPingPeriod = "OPENEBS_IO_ANALYTICS_PING_INTERVAL"
OpenEBSPingPeriod ping interval of volume io analytics
Functions ¶
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application struct holds details about the Application
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is a represents usage of OpenEBS Event contains all the query param fields when hits is of type='event' Ref: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ec
type Gclient ¶
type Gclient struct {
// contains filtered or unexported fields
}
Gclient struct represents a Google Analytics hit
type Usage ¶
type Usage struct { // Embedded Event struct as we are currently only sending hits of type // 'event' Event // https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#an // use-case: cstor or jiva volume, or m-apiserver application // Embedded field for application Application // Embedded Gclient struct Gclient }
Usage struct represents all information about a usage metric sent to Google Analytics with respect to the application
func (*Usage) ApplicationBuilder ¶
ApplicationBuilder Application builder is used for adding k8s&openebs environment detail for non install events
func (*Usage) InstallBuilder ¶
InstallBuilder is a concrete builder for install events
func (*Usage) NewEvent ¶
NewEvent returns an Event struct with eventCategory, eventAction, eventLabel, eventValue fields
func (*Usage) Send ¶
func (u *Usage) Send()
Send sends a single usage metric to Google Analytics with some compulsory fields defined in Google Analytics API bindings(jpillora/go-ogle-analytics)
func (*Usage) SetApplicationID ¶
SetApplicationID : usecase(OpenEBS/NDM)
func (*Usage) SetApplicationInstallerID ¶
SetApplicationInstallerID : usecase(k8s-version)
func (*Usage) SetApplicationName ¶
SetApplicationName : usecase(os-type/arch, volume CASType)
func (*Usage) SetApplicationVersion ¶
SetApplicationVersion : usecase(project-version)
func (*Usage) SetCampaignName ¶ added in v0.8.0
SetCampaignName : set the name of the PVC or will be empty.
func (*Usage) SetCampaignSource ¶
SetCampaignSource : source of openebs installater like: helm or operator etc. This will have to be configured via ENV variable OPENEBS_IO_INSTALLER_TYPE
func (*Usage) SetCategory ¶
SetCategory sets the category of an event
func (*Usage) SetClientID ¶
SetClientID sets the anonymous user id
func (*Usage) SetDataSource ¶
SetDataSource : usage(os-type, kernel)
func (*Usage) SetDocumentTitle ¶
SetDocumentTitle : usecase(anonymous-id)
func (*Usage) SetReplicaCount ¶
SetReplicaCount Wrapper for setting replica count for volume events NOTE: This doesn't get the replica count in a volume de-provision event. TODO: Pick the current value of replica-count from the CAS-engine
func (*Usage) SetTrackingID ¶
SetTrackingID Sets the GA-code for the project
func (*Usage) SetVolumeCapacity ¶
SetVolumeCapacity sets the storage capacity of the volume for a volume event
func (*Usage) SetVolumeType ¶
SetVolumeType Wrapper for setting the default storage-engine for volume-provision event
type VersionSet ¶ added in v0.9.0
type VersionSet struct {
// contains filtered or unexported fields
}
VersionSet is a struct which stores (sort of) fixed information about a k8s environment