Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5dae382

Browse files
committed
[samplecode][2/3]Implemente Unary Paged RPC method's sample code (#576)
1 parent f5d2f8f commit 5dae382

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/integration/goldens/logging/MetricsClient.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ public MetricsServiceV2Stub getStub() {
151151
/**
152152
* Lists logs-based metrics.
153153
*
154+
* <p>Sample code:
155+
*
156+
* <pre>{@code
157+
* try (MetricsClient metricsClient = MetricsClient.create()) {
158+
* ProjectName parent = ProjectName.of("[PROJECT]");
159+
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
160+
* // doThingsWith(element);
161+
* }
162+
* }
163+
* }</pre>
164+
*
154165
* @param parent Required. The name of the project containing the metrics:
155166
* <p>"projects/[PROJECT_ID]"
156167
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -167,6 +178,17 @@ public final ListLogMetricsPagedResponse listLogMetrics(ProjectName parent) {
167178
/**
168179
* Lists logs-based metrics.
169180
*
181+
* <p>Sample code:
182+
*
183+
* <pre>{@code
184+
* try (MetricsClient metricsClient = MetricsClient.create()) {
185+
* String parent = ProjectName.of("[PROJECT]").toString();
186+
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
187+
* // doThingsWith(element);
188+
* }
189+
* }
190+
* }</pre>
191+
*
170192
* @param parent Required. The name of the project containing the metrics:
171193
* <p>"projects/[PROJECT_ID]"
172194
* @throws com.google.api.gax.rpc.ApiException if the remote call fails

0 commit comments

Comments
 (0)