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

Skip to content

Commit 55dd1cd

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

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
@@ -152,6 +152,17 @@ public MetricsServiceV2Stub getStub() {
152152
/**
153153
* Lists logs-based metrics.
154154
*
155+
* <p>Sample code:
156+
*
157+
* <pre>{@code
158+
* try (MetricsClient metricsClient = MetricsClient.create()) {
159+
* ProjectName parent = ProjectName.of("[PROJECT]");
160+
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
161+
* // doThingsWith(element);
162+
* }
163+
* }
164+
* }</pre>
165+
*
155166
* @param parent Required. The name of the project containing the metrics:
156167
* <p>"projects/[PROJECT_ID]"
157168
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -168,6 +179,17 @@ public final ListLogMetricsPagedResponse listLogMetrics(ProjectName parent) {
168179
/**
169180
* Lists logs-based metrics.
170181
*
182+
* <p>Sample code:
183+
*
184+
* <pre>{@code
185+
* try (MetricsClient metricsClient = MetricsClient.create()) {
186+
* String parent = ProjectName.of("[PROJECT]").toString();
187+
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
188+
* // doThingsWith(element);
189+
* }
190+
* }
191+
* }</pre>
192+
*
171193
* @param parent Required. The name of the project containing the metrics:
172194
* <p>"projects/[PROJECT_ID]"
173195
* @throws com.google.api.gax.rpc.ApiException if the remote call fails

0 commit comments

Comments
 (0)