Cli: better estimate of epoch time elapsed/remaining (#15893) (#15918)

* Add rpc_client api for getRecentPerformanceSamples

* Prep fn for variable avg slot time

* Use recent-perf-samples to more-accurately estimate epoch completed times

* Spell out average

(cherry picked from commit 3726358f51)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
mergify[bot]
2021-03-16 09:58:51 +00:00
committed by GitHub
parent 5500970a7e
commit 97ec4cd44e
4 changed files with 33 additions and 15 deletions

View File

@@ -644,6 +644,13 @@ impl RpcClient {
self.send(RpcRequest::GetEpochSchedule, Value::Null)
}
pub fn get_recent_performance_samples(
&self,
limit: Option<usize>,
) -> ClientResult<Vec<RpcPerfSample>> {
self.send(RpcRequest::GetRecentPerformanceSamples, json!([limit]))
}
pub fn get_identity(&self) -> ClientResult<Pubkey> {
let rpc_identity: RpcIdentity = self.send(RpcRequest::GetIdentity, Value::Null)?;