MCPcopy
hub / github.com/brianfrankcooper/YCSB / format

Method format

core/src/main/java/site/ycsb/Client.java:45–70  ·  view source on GitHub ↗
(long seconds)

Source from the content-addressed store, hash-verified

43 }
44
45 public static StringBuilder format(long seconds) {
46 StringBuilder time = new StringBuilder();
47 long days = TimeUnit.SECONDS.toDays(seconds);
48 if (days > 0) {
49 time.append(days).append(days == 1 ? " day " : " days ");
50 seconds -= TimeUnit.DAYS.toSeconds(days);
51 }
52 long hours = TimeUnit.SECONDS.toHours(seconds);
53 if (hours > 0) {
54 time.append(hours).append(hours == 1 ? " hour " : " hours ");
55 seconds -= TimeUnit.HOURS.toSeconds(hours);
56 }
57 /* Only include minute granularity if we're < 1 day. */
58 if (days < 1) {
59 long minutes = TimeUnit.SECONDS.toMinutes(seconds);
60 if (minutes > 0) {
61 time.append(minutes).append(minutes == 1 ? " minute " : " minutes ");
62 seconds -= TimeUnit.MINUTES.toSeconds(seconds);
63 }
64 }
65 /* Only bother to include seconds if we're < 1 minute */
66 if (time.length() == 0) {
67 time.append(seconds).append(time.length() == 1 ? " second " : " seconds ");
68 }
69 return time;
70 }
71}
72
73/**

Callers 15

computeStatsMethod · 0.95
toStringMethod · 0.80
testScanMethod · 0.80
testScanMethod · 0.80
initMethod · 0.80
extractResultMethod · 0.80
initMethod · 0.80
exportMeasurementsMethod · 0.80
getSummaryMethod · 0.80
getSummaryMethod · 0.80
getSummaryMethod · 0.80
getSummaryMethod · 0.80

Calls

no outgoing calls

Tested by 15

toStringMethod · 0.64
testScanMethod · 0.64
testScanMethod · 0.64
testScanMethod · 0.64
testScanMethod · 0.64
testScanMethod · 0.64
getDBMethod · 0.64
setUpMethod · 0.64
prepareTestMethod · 0.64
insertTestMethod · 0.64
updateTestMethod · 0.64
deleteTestMethod · 0.64