mirror of
https://github.com/google/nomulus.git
synced 2025-07-13 14:35:16 +02:00
Record metrics for WHOIS commands
Note that this does not write out metrics for invocations of the nomulus tool. This requires a slight refactoring of the existing WhoisResponse interface so as to also support returning the number of results found by the WHOIS query. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149461208
This commit is contained in:
parent
4eef02f17f
commit
3fcb564251
15 changed files with 247 additions and 62 deletions
|
@ -42,7 +42,7 @@ final class NameserverWhoisResponse extends WhoisResponseImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getPlainTextOutput(boolean preferUnicode, String disclaimer) {
|
||||
public WhoisResponseResults getResponse(boolean preferUnicode, String disclaimer) {
|
||||
BasicEmitter emitter = new BasicEmitter();
|
||||
for (int i = 0; i < hosts.size(); i++) {
|
||||
HostResource host = hosts.get(i);
|
||||
|
@ -63,6 +63,7 @@ final class NameserverWhoisResponse extends WhoisResponseImpl {
|
|||
emitter.emitNewline();
|
||||
}
|
||||
}
|
||||
return emitter.emitLastUpdated(getTimestamp()).emitFooter(disclaimer).toString();
|
||||
String plaintext = emitter.emitLastUpdated(getTimestamp()).emitFooter(disclaimer).toString();
|
||||
return WhoisResponseResults.create(plaintext, hosts.size());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue