mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 12:08:36 +02:00
Remove TLD @Parameter from inside the DnsMetrics
Currently, the TLD is a "hidden" part of the metric - we record it, but by looking at the call site you can't see that we record it. Also, it's injected from the query / POST parameter, so we might not even be aware of what the value is and it might not be the value we wanted. Instead, making it explicit in the Metric call. That way it's also more similar to the "logging" statements that record the same data but have to explicitly output the TLD. It also makes the tests better, as we test that we indeed record the correct TLD ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=229550115
This commit is contained in:
parent
bc798f33e9
commit
8cfb748316
3 changed files with 52 additions and 43 deletions
|
@ -96,6 +96,7 @@ public final class PublishDnsUpdatesAction implements Runnable, Callable<Void> {
|
|||
DateTime now = clock.nowUtc();
|
||||
|
||||
dnsMetrics.recordActionResult(
|
||||
tld,
|
||||
dnsWriter,
|
||||
status,
|
||||
nullToEmpty(domains).size() + nullToEmpty(hosts).size(),
|
||||
|
@ -197,8 +198,8 @@ public final class PublishDnsUpdatesAction implements Runnable, Callable<Void> {
|
|||
domainsPublished += 1;
|
||||
}
|
||||
}
|
||||
dnsMetrics.incrementPublishDomainRequests(domainsPublished, PublishStatus.ACCEPTED);
|
||||
dnsMetrics.incrementPublishDomainRequests(domainsRejected, PublishStatus.REJECTED);
|
||||
dnsMetrics.incrementPublishDomainRequests(tld, domainsPublished, PublishStatus.ACCEPTED);
|
||||
dnsMetrics.incrementPublishDomainRequests(tld, domainsRejected, PublishStatus.REJECTED);
|
||||
|
||||
int hostsPublished = 0;
|
||||
int hostsRejected = 0;
|
||||
|
@ -213,8 +214,8 @@ public final class PublishDnsUpdatesAction implements Runnable, Callable<Void> {
|
|||
hostsPublished += 1;
|
||||
}
|
||||
}
|
||||
dnsMetrics.incrementPublishHostRequests(hostsPublished, PublishStatus.ACCEPTED);
|
||||
dnsMetrics.incrementPublishHostRequests(hostsRejected, PublishStatus.REJECTED);
|
||||
dnsMetrics.incrementPublishHostRequests(tld, hostsPublished, PublishStatus.ACCEPTED);
|
||||
dnsMetrics.incrementPublishHostRequests(tld, hostsRejected, PublishStatus.REJECTED);
|
||||
|
||||
// If we got here it means we managed to stage the entire batch without any errors.
|
||||
// Next we will commit the batch.
|
||||
|
@ -229,11 +230,7 @@ public final class PublishDnsUpdatesAction implements Runnable, Callable<Void> {
|
|||
recordActionResult(actionStatus);
|
||||
Duration duration = new Duration(timeAtStart, clock.nowUtc());
|
||||
dnsMetrics.recordCommit(
|
||||
dnsWriter,
|
||||
commitStatus,
|
||||
duration,
|
||||
domainsPublished,
|
||||
hostsPublished);
|
||||
tld, dnsWriter, commitStatus, duration, domainsPublished, hostsPublished);
|
||||
logger.atInfo().log(
|
||||
"writer.commit() statistics: TLD: %s, dnsWriter: %s, commitStatus: %s, duration: %s, "
|
||||
+ "domainsPublished: %d, domainsRejected: %d, hostsPublished: %d, hostsRejected: %d",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue