package main_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gexec"

	"github.com/cloudfoundry-incubator/cf-test-helpers/generator"

	"time"

	"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
)

var _ = Describe("Pushing an app", func() {
	It("stops the time for pushing an app", func() {
		for index := 0; index < loopCount; index++ {
			startTime := time.Now()

			appName := generator.PrefixedRandomName("APP")
			Expect(
				cf.Cf("push", appName, "-p", "assets/dora").Wait(cfPushTimeout)).
				To(Exit(0))

			statsdClient.Timing(metricsPrefix+"cf-push", time.Since(startTime).Seconds()*1000)
		}
	})
})

package main_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gexec"

	"github.com/cloudfoundry-incubator/cf-test-helpers/generator"

	"time"

	"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
)

var _ = Describe("Pushing an app", func() {
	It("stops the time for pushing an app", func() {
		for index := 0; index < loopCount; index++ {
			startTime := time.Now()

			appName := generator.PrefixedRandomName("APP")
			Expect(
				cf.Cf("push", appName, "-p", "assets/dora").Wait(cfPushTimeout)).
				To(Exit(0))

			statsdClient.Timing(asSparseMetric("cf-push"), time.Since(startTime).Seconds()*1000)
		}
	})
})

func asSparseMetric(metricName string) string {
	return metricsPrefix + metricName + ".sparse-avg"
}

Add sparse-avg suffix to metrics name
Add sparse-avg suffix to metrics name

This enables us to see this metric even when specifying a time window of more than 24h in logmet.

Signed-off-by: Alexander Egurnov <7763625750474092f7412e5c40b7d702fa97cda8@de.ibm.com>
