It("increments the requests counter by one", func() { statusCode := int32(404) httpStartStopEvent.StatusCode = &statusCode metric := processor.ProcessHttpStartStopHttpRequestCount(httpStartStopEvent) Expect(metric.Stat).To(Equal("http.requests.api_10_244_0_34_xip_io")) Expect(metric.Value).To(Equal(int64(1))) }) }) Context("when PeerType == PeerType_Client", func() { It("sets the increment value for the CounterMetric to 1", func() { metric := processor.ProcessHttpStartStopStatusCodeCount(httpStartStopEvent) Expect(metric.Value).To(Equal(int64(1))) }) }) Context("when PeerType == PeerType_Server", func() { It("sets the increment value for the CounterMetric to 0", func() { peerType := events.PeerType_Server httpStartStopEvent.PeerType = &peerType metric := processor.ProcessHttpStartStopStatusCodeCount(httpStartStopEvent) Expect(metric.Value).To(Equal(int64(0))) }) }) }) })