/** * Add a value to the list. * (Timestamp assigned to this value is the current timestamp.) * @param value The Gauge value to be added */ public void add(T value) { this.elements.add(new TimestampedValue<T>(value, Instant.now().toEpochMilli())); // perform any evictions that may be needed. this.evict(); }
/** * Add a value to the list. * (Timestamp assigned to this value is the current timestamp.) * @param value The Gauge value to be added */ public void add(T value) { this.elements.add(new TimestampedValue<T>(value, Instant.now().toEpochMilli())); // perform any evictions that may be needed. this.evict(); }
/** * Get the Collection of values currently in the list. * @return the collection of values */ public Collection<T> getValues() { this.evict(); return Collections.unmodifiableList(this.elements.stream().map(x -> x.getValue()).collect(Collectors.toList())); }
/** * Get the Collection of values currently in the list. * @return the collection of values */ public Collection<T> getValues() { this.evict(); return Collections.unmodifiableList(this.elements.stream().map(x -> x.getValue()).collect(Collectors.toList())); }