本文整理匯總了Golang中github.com/cloudfoundry-incubator/garden/client/connection/fakes.FakeConnection.BulkMetricsReturns方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeConnection.BulkMetricsReturns方法的具體用法?Golang FakeConnection.BulkMetricsReturns怎麽用?Golang FakeConnection.BulkMetricsReturns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry-incubator/garden/client/connection/fakes.FakeConnection
的用法示例。
在下文中一共展示了FakeConnection.BulkMetricsReturns方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
},
"handle2": garden.ContainerMetricsEntry{
Metrics: garden.Metrics{
DiskStat: garden.ContainerDiskStat{
TotalInodesUsed: 5,
TotalBytesUsed: 6,
ExclusiveBytesUsed: 7,
ExclusiveInodesUsed: 8,
},
},
},
}
handles := []string{"handle1", "handle2"}
It("gets info for the requested containers", func() {
fakeConnection.BulkMetricsReturns(expectedBulkMetrics, nil)
bulkInfo, err := client.BulkMetrics(handles)
Ω(err).ShouldNot(HaveOccurred())
Ω(fakeConnection.BulkMetricsCallCount()).Should(Equal(1))
Ω(fakeConnection.BulkMetricsArgsForCall(0)).Should(Equal(handles))
Ω(bulkInfo).Should(Equal(expectedBulkMetrics))
})
Context("when there is a error with the connection", func() {
expectedBulkMetrics := map[string]garden.ContainerMetricsEntry{}
BeforeEach(func() {
fakeConnection.BulkMetricsReturns(expectedBulkMetrics, errors.New("Oh noes!"))
})