Skip to content
Merged
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
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022-2023 Oak Ridge National Laboratory.
* Copyright (c) 2022-2025 Oak Ridge National Laboratory.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -164,14 +164,22 @@ else if (arg.startsWith("-v") && (i+1) < args.length)
System.out.println("Run 'pvget QUIT' to stop");
while (! done.await(update_period, TimeUnit.SECONDS))
{
System.out.println("\nCount Name Last Client Age");
int max_name = 10, max_client = 10;
for (SearchInfo info : searches.values())
{
max_name = Math.max(max_name, info.name.length());
max_client = Math.max(max_client, info.client.toString().length());
}

System.out.format("\nCount %-" + max_name + "s %-" + max_client + "s Age\n", "Name", "Last Client");
final String format = "%5d %-" + max_name + "s %-" + max_client + "s %6d sec\n";
final Instant now = Instant.now();
searches.values()
.stream()
.sorted()
.forEach(info ->
{
System.out.format("%5d %-20s %-35s %6d sec\n",
System.out.format(format,
info.count.get(),
info.name,
info.client.toString(),
Expand Down