Skip to content

Commit

Permalink
Add sample for edenfs_events scuba table
Browse files Browse the repository at this point in the history
Reviewed By: jdelliot

Differential Revision: D68295463

fbshipit-source-id: 841be16ac662d5681f476e7a0cb14425f9ab70aa
  • Loading branch information
lXXXw authored and facebook-github-bot committed Jan 23, 2025
1 parent 7df5f10 commit 5efb53a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions eden/fs/cli_rs/edenfs-commands/src/remove/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ use std::sync::Arc;
use anyhow::Result;
use crossterm::style::Stylize;
use dialoguer::Confirm;
#[cfg(fbcode_build)]
use edenfs_telemetry::send;
#[cfg(fbcode_build)]
use edenfs_telemetry::EDEN_EVENTS_SCUBA;
use io::IO;
use termlogger::TermLogger;

Expand All @@ -26,6 +30,17 @@ pub enum PathType {
Unknown,
}

impl std::fmt::Display for PathType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
PathType::ActiveEdenMount => write!(f, "active edenfs mount"),
PathType::InactiveEdenMount => write!(f, "inactive edenfs mount"),
PathType::RegularFile => write!(f, "regular file"),
PathType::Unknown => write!(f, "unknown"),
}
}
}

impl PathType {
pub fn get_prompt(&self, paths: Vec<&str>) -> String {
let prompt_str = match self {
Expand Down Expand Up @@ -60,6 +75,12 @@ impl PathType {
}

pub async fn remove(&self, context: &RemoveContext) -> Result<()> {
#[cfg(fbcode_build)]
{
let sample = edenfs_telemetry::remove::build(&self.to_string());
send(EDEN_EVENTS_SCUBA.to_string(), sample);
}

match self {
PathType::ActiveEdenMount => operations::remove_active_eden_mount(context).await,
PathType::InactiveEdenMount => operations::remove_inactive_eden_mount(context).await,
Expand Down

0 comments on commit 5efb53a

Please sign in to comment.