Skip to content

Commit

Permalink
Fixing google analytics
Browse files Browse the repository at this point in the history
Signed-off-by: mayank <[email protected]>
  • Loading branch information
mayank authored and kmova committed Jun 11, 2021
1 parent 335880c commit a1ce855
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
4 changes: 3 additions & 1 deletion buildscripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ if [ $GOOS = "windows" ]; then
fi

env GOOS=$GOOS GOARCH=$GOARCH go build ${BUILD_TAG} -ldflags \
"-X github.com/openebs/dynamic-nfs-provisioner/provisioner.NFSServerDefaultImage=${NFSSERVERIMG}" \
"-X github.com/openebs/dynamic-nfs-provisioner/provisioner.NFSServerDefaultImage=${NFSSERVERIMG}
-X github.com/openebs/maya/pkg/version.GitCommit=${GIT_COMMIT}
-X github.com/openebs/maya/pkg/version.Version=${VERSION}" \
-o $output_name\
./cmd/${CTLNAME}

Expand Down
23 changes: 13 additions & 10 deletions provisioner/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,20 @@ func (p *Provisioner) Delete(pv *v1.PersistentVolume) (err error) {

// sendEventOrIgnore sends anonymous nfs-pv provision/delete events
func sendEventOrIgnore(pvcName, pvName, capacity, stgType, method string) {
if !menv.Truthy(menv.OpenEBSEnableAnalytics) {
return
}

if method == analytics.VolumeProvision {
stgType = "nfs-" + stgType
}
if menv.Truthy(menv.OpenEBSEnableAnalytics) {
analytics.New().Build().ApplicationBuilder().
SetVolumeType(stgType, method).
SetDocumentTitle(pvName).
SetCampaignName(pvcName).
SetLabel(analytics.EventLabelCapacity).
//TODO SetReplicaCount("", method).
SetCategory(method).
SetVolumeCapacity(capacity).Send()
}

analytics.New().Build().ApplicationBuilder().
SetVolumeType(stgType, method).
SetDocumentTitle(pvName).
SetCampaignName(pvcName).
SetLabel(analytics.EventLabelCapacity).
SetReplicaCount("", method).
SetCategory(method).
SetVolumeCapacity(capacity).Send()
}

0 comments on commit a1ce855

Please sign in to comment.