Skip to content

Collect telemetry for upload path #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

port8080
Copy link
Contributor

@port8080 port8080 commented Oct 4, 2024

Get the telemetry data to the py layer. This will be sent over the telemetry endpoint later.

Related to STO-7

@port8080 port8080 requested a review from seanses October 4, 2024 19:32
@port8080 port8080 force-pushed the ajit/add-xet-telemetry branch from 0f05b62 to b08974a Compare October 7, 2024 20:35
Get the telemetry data to the py layer. This will be sent over the
telemetry endpoint later.

Related to STO-7
@port8080 port8080 force-pushed the ajit/add-xet-telemetry branch from b08974a to bd328fd Compare October 8, 2024 00:39
@port8080 port8080 marked this pull request as ready for review October 8, 2024 00:40
@port8080 port8080 requested review from assafvayner and ylow October 8, 2024 00:40
@@ -42,7 +42,7 @@ pub trait UploadClient {
#[async_trait]
pub trait ReconstructionClient {
/// Get a entire file by file hash.
async fn get_file(&self, hash: &MerkleHash, writer: &mut Box<dyn Write + Send>) -> Result<()>;
async fn get_file(&self, hash: &MerkleHash, writer: &mut Box<dyn Write + Send>) -> Result<u64>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment for what this return value is, presumably amount written to writer

@@ -215,7 +215,8 @@ impl RemoteClient {
.map_err(|e| CasClientError::InternalError(anyhow!("join error {e}")))??;
writer.write_all(&piece)?;
}
Ok(total_len as usize)
// Todo: return the bytes which were read from the cache for telemetry
Ok(total_len as u64)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this total len is the uncompressed length of the section, not the number of bytes over the network which is what I think you're attempting to track that number should be the difference in the url_range end - start for each piece.

@@ -283,29 +288,37 @@ pub(crate) async fn register_new_cas_block(
cas_data.chunks.clear();
cas_data.pending_file_info.clear();

Ok(cas_hash)
Ok((cas_hash, compressed_bytes_len as u64))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: using compressed_bytes_len from client side is unreliable, people can inject any number here and that does not impact clean process correctness.

@@ -577,13 +585,14 @@ impl Cleaner {
if cas_data_accumulator.data.len() >= TARGET_CAS_BLOCK_SIZE {
let mut new_cas_data = take(cas_data_accumulator.deref_mut());
drop(cas_data_accumulator); // Release the lock.
register_new_cas_block(
let (_cas_hash, compressed_bytes) = register_new_cas_block(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This compressed_bytes

  • doesn't include all bytes produced by this file after dedup: they are also produced in fn dedup(...). I noticed you modified that function but the return value is not used?
  • data in this cas_data_accumulator may also include bytes produced by other files cleaned before this file using the same PointerFileTranslator.

Copy link
Collaborator

@seanses seanses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic to count bytes produced by one file after dedup doesn't seem correct.

@seanses seanses mentioned this pull request Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants