use crate::presentation::text_value::field;
use ic_query::report::ReportProvenance;
pub fn push_report_provenance_lines(lines: &mut Vec<String>, provenance: &ReportProvenance) {
lines.push(field("data_source", &(provenance.data_source())));
if let Some(cache_path) = provenance.cache_path() {
lines.push(field("cache_path", &cache_path));
lines.push("cache_complete: yes".to_string());
}
}
#[cfg(test)]
mod tests;
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct TextOptions {
pub verbose: bool,
}
pub fn refresh_attempt_lines(
attempt: &ic_query::cache::SnapshotRefreshAttemptStatus,
) -> [String; 8] {
crate::presentation::text_value::report_fields!(attempt;
attempt_status = attempt.status,
attempt_started_at = &attempt.started_at,
attempt_updated_at = &attempt.updated_at,
attempt_page_size = attempt.page_size,
attempt_pages_fetched = attempt.pages_fetched,
attempt_rows_fetched = attempt.rows_fetched,
attempt_last_cursor = crate::presentation::text_value::optional_text(attempt.last_cursor.as_ref()),
attempt_last_error = crate::presentation::text_value::optional_text(attempt.last_error.as_ref()),
)
}