本文整理汇总了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)
}