Documentation ¶
Overview ¶
Copyright 2018 The OpenEBS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 The OpenEBS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 The OpenEBS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 The OpenEBS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func NewVersion() *versionSet
- 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
Constants ¶
const ( // GAclientID is the unique code of OpenEBS project in Google Analytics GAclientID string = "UA-127388617-1" // Install event is sent on pod starts InstallEvent string = "install" // Ping event is sent periodically Ping string = "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 string = "OpenEBS" // Event labels RunningStatus string = "running" EventLabelNode string = "nodes" EventLabelCapacity string = "capacity" // Event action Replica string = "replica:" DefaultReplicaCount string = "replica:3" // Event application name constant for volume event DefaultCASType string = "jiva" // LocalPVReplicaCount is the constant used by usage to represent // replication factor in LocalPV LocalPVReplicaCount string = "1" )
Variables ¶
var OpenEBSPingPeriod menv.ENVKey = "OPENEBS_IO_ANALYTICS_PING_INTERVAL"
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 ¶
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 v1.11.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 ¶
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 ¶
Wrapper for setting the default storage-engine for volume-provision event