k8s/io/kubernetes/pkg/api/v1.Probe 示例代码

2022-03-03

以下示例是关于golang中包含v1.Probe用法的示例代码,想了解v1.Probe的具体用法?v1.Probe怎么用?v1.Probe使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
probe_test.go开发语言: Go项目名称: kubernetes代码行数: 245
1/*
2Copyright 2015 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
示例2:
probe.go开发语言: Go项目名称: kubernetes代码行数: 209
1/*
2Copyright 2014 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
示例3:
kubelet.go开发语言: Go项目名称: kubernetes代码行数: 1747
1/*
2Copyright 2014 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
示例4:
nodecontroller_test.go开发语言: Go项目名称: kubernetes代码行数: 970
1/*
2Copyright 2014 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
示例5:
letters_test.go开发语言: Go项目名称: biogo代码行数: 92
1// Copyright ©2011-2012 The bíogo Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package alphabet
6
7import (
8	"fmt"
9	check "launchpad.net/gocheck"
10	"math"
11)
12
13type approxChecker struct {
14	*check.CheckerInfo
15}
示例6:
probe.go开发语言: Go项目名称: camlistore代码行数: 75
1// Copyright (c) 2011 CZ.NIC z.s.p.o. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// blame: jnml, labs.nic.cz
6
7package storage
8
9import "sync/atomic"
10
11// Probe collects usage statistics of the embeded Accessor.
12// Probe itself IS an Accessor.
13type Probe struct {
14	Accessor
15	Chain     *Probe
示例7:
http.go开发语言: Go项目名称: kubernetes代码行数: 80
1/*
2Copyright 2015 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
示例8:
main.go开发语言: Go项目名称: aquakeen代码行数: 116
1package main
2
3import (
4	"bytes"
5	"encoding/json"
6	"encoding/xml"
7	"flag"
8	"fmt"
9	"io/ioutil"
10	"net/http"
11	"strconv"
12	"strings"
13	"time"
14)
15
示例9:
probe_test.go开发语言: Go项目名称: camlistore代码行数: 87
1// Copyright (c) 2011 CZ.NIC z.s.p.o. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// blame: jnml, labs.nic.cz
6
7package storage
8
9import (
10	"os"
11	"testing"
12)
13
14func (p *Probe) assert(t *testing.T, msg int, opsRd, opsWr, bytesRd, bytesWr, sectorsRd, sectorsWr int64) {
15	if n := p.OpsRd; n != opsRd {
示例10:
types.go开发语言: Go项目名称: kubernetes代码行数: 1139
1/*
2Copyright 2014 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/

本文地址:https://www.itbaoku.cn/snippets/415870.html