Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,7 @@ static Set<AuthAction> getAuthActions(List<String> actions) {

<T> void print(List<T> items) {
for (T item : items) {
System.out.println(item);
}
}

<T> void printList(T item) {
try {
System.out.println(writer.writeValueAsString(item));
} catch (Exception e) {
throw new RuntimeException(e);
print(item);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FunctionsStats extends BaseCommand {

@Override
void runCmd() throws Exception {
printList(admin.worker().getFunctionsStats());
print(admin.worker().getFunctionsStats());
}
}

Expand All @@ -59,7 +59,7 @@ class CmdMonitoringMetrics extends BaseCommand {

@Override
void runCmd() throws Exception {
printList(admin.worker().getMetrics());
print(admin.worker().getMetrics());
}
}

Expand All @@ -68,7 +68,7 @@ class GetCluster extends BaseCommand {

@Override
void runCmd() throws Exception {
printList(admin.worker().getCluster());
print(admin.worker().getCluster());
}
}

Expand Down