Remove collaborators_per_project
from Metrics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
63e1845537
commit
f4e5cb14bf
2 changed files with 4 additions and 14 deletions
|
@ -1097,10 +1097,9 @@ impl<'a> Drop for StoreWriteGuard<'a> {
|
||||||
|
|
||||||
let metrics = self.metrics();
|
let metrics = self.metrics();
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
connections = metrics.connections as f32,
|
connections = metrics.connections,
|
||||||
registered_projects = metrics.registered_projects as f32,
|
registered_projects = metrics.registered_projects,
|
||||||
shared_projects = metrics.shared_projects as f32,
|
shared_projects = metrics.shared_projects,
|
||||||
collaborators_per_project = metrics.collaborators_per_project,
|
|
||||||
"metrics"
|
"metrics"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ pub struct Metrics {
|
||||||
pub connections: usize,
|
pub connections: usize,
|
||||||
pub registered_projects: usize,
|
pub registered_projects: usize,
|
||||||
pub shared_projects: usize,
|
pub shared_projects: usize,
|
||||||
pub collaborators_per_project: f32,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Store {
|
impl Store {
|
||||||
|
@ -94,25 +93,17 @@ impl Store {
|
||||||
let connections = self.connections.len();
|
let connections = self.connections.len();
|
||||||
let mut registered_projects = 0;
|
let mut registered_projects = 0;
|
||||||
let mut shared_projects = 0;
|
let mut shared_projects = 0;
|
||||||
let mut collaborators = 0;
|
|
||||||
for project in self.projects.values() {
|
for project in self.projects.values() {
|
||||||
registered_projects += 1;
|
registered_projects += 1;
|
||||||
if let Some(share) = project.share.as_ref() {
|
if project.share.is_some() {
|
||||||
shared_projects += 1;
|
shared_projects += 1;
|
||||||
collaborators += share.active_replica_ids.len();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let collaborators_per_project = if shared_projects == 0 || collaborators == 0 {
|
|
||||||
0.
|
|
||||||
} else {
|
|
||||||
collaborators as f32 / shared_projects as f32
|
|
||||||
};
|
|
||||||
|
|
||||||
Metrics {
|
Metrics {
|
||||||
connections,
|
connections,
|
||||||
registered_projects,
|
registered_projects,
|
||||||
shared_projects,
|
shared_projects,
|
||||||
collaborators_per_project,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue