feat(server): add tracing spans and caching to archive and blame services

- Add tracing spans with repo labels for archive and blame operations
- Implement caching for archive list entries when using OID selectors
- Implement caching for blame operations when using OID selectors
- Add detailed
This commit is contained in:
zhenyi
2026-06-04 15:33:16 +08:00
parent 729604f13b
commit cc202d6d1f
41 changed files with 2400 additions and 1067 deletions
+4 -6
View File
@@ -4,12 +4,10 @@ use crate::paginate;
use crate::pb::{
FileMetadata, FindFilesRequest, FindFilesResponse, ListTreeRequest, ObjectType, tree_entry,
};
use crate::tree;
impl GitBare {
pub fn find_files(&self, request: FindFilesRequest) -> GitResult<FindFilesResponse> {
let revision = request.revision.clone();
let rev = tree::resolve_revision(&revision);
let root = if request.pathspec.is_empty() {
vec![String::new()]
} else {
@@ -37,17 +35,17 @@ impl GitBare {
tree_entry::EntryType::TreeEntryTypeUnspecified => ObjectType::Unspecified,
_ => ObjectType::Blob,
} as i32;
let entry_path = entry.path.clone();
let rc = tree::recent_commit(self, &rev, &entry_path);
// recent_commit is NOT computed here to avoid N subprocess calls.
// Use get_file_metadata for per-file commit info.
files.push(FileMetadata {
path: entry_path,
path: entry.path,
oid: entry.oid,
mode: entry.mode,
size: entry.size,
r#type: object_type,
binary: false,
is_lfs: false,
recent_commit: rc,
recent_commit: None,
});
}
}