本文整理匯總了Golang中k8s/io/kubernetes/pkg/apis/meta/v1.Time.Now方法的典型用法代碼示例。如果您正苦於以下問題:Golang Time.Now方法的具體用法?Golang Time.Now怎麽用?Golang Time.Now使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類k8s/io/kubernetes/pkg/apis/meta/v1.Time
的用法示例。
在下文中一共展示了Time.Now方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestScaleDownRCImmediately
func TestScaleDownRCImmediately(t *testing.T) {
time := metav1.Time{Time: time.Now()}
tc := testCase{
minReplicas: 2,
maxReplicas: 5,
initialReplicas: 6,
desiredReplicas: 5,
CPUTarget: 50,
reportedLevels: []uint64{8000, 9500, 1000},
reportedCPURequests: []resource.Quantity{resource.MustParse("0.9"), resource.MustParse("1.0"), resource.MustParse("1.1")},
useMetricsApi: true,
lastScaleTime: &time,
}
tc.runTest(t)
}
示例2: TestScaleUpRCImmediately
func TestScaleUpRCImmediately(t *testing.T) {
time := metav1.Time{Time: time.Now()}
tc := testCase{
minReplicas: 2,
maxReplicas: 6,
initialReplicas: 1,
desiredReplicas: 2,
verifyCPUCurrent: true,
reportedLevels: []uint64{0, 0, 0, 0},
reportedCPURequests: []resource.Quantity{resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0")},
useMetricsApi: true,
lastScaleTime: &time,
}
tc.runTest(t)
}