Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32563461
D4581.1767354386.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4581.1767354386.diff
View Options
diff --git a/services/commtest/tests/blob_performance_test.rs b/services/commtest/tests/blob_performance_test.rs
--- a/services/commtest/tests/blob_performance_test.rs
+++ b/services/commtest/tests/blob_performance_test.rs
@@ -1,7 +1,55 @@
+#[path = "./blob/blob_utils.rs"]
+mod blob_utils;
#[path = "./lib/tools.rs"]
mod tools;
+use bytesize::ByteSize;
+
+use tokio::runtime::Runtime;
+use tools::Error;
+
+use blob_utils::BlobData;
+
#[tokio::test]
-async fn blob_performance_test() {
- assert!(false, "not implemented");
+async fn blob_performance_test() -> Result<(), Error> {
+
+ // change this value to test more simultaneous connections
+ const NUMBER_OF_THREADS: usize = 5;
+
+ let mut blob_data = vec![];
+
+ for i in 0..NUMBER_OF_THREADS {
+ let index: u64 = (i as u64) % 10;
+ blob_data.push(BlobData {
+ holder: format!("test_holder_{}", i),
+ hash: format!("test_hash_{}", i),
+ chunks_sizes: vec![
+ ByteSize::kib(200 + (300 - index * 20)).as_u64() as usize,
+ ByteSize::kib(500 + (400 - index * 20)).as_u64() as usize,
+ ByteSize::kib(700 + (500 - index * 25)).as_u64() as usize,
+ ],
+ })
+ }
+
+ let rt = Runtime::new().unwrap();
+ tokio::task::spawn_blocking(move || {
+ // PUT
+ rt.block_on(async {
+ println!("performing PUT operations");
+ });
+
+ // GET
+ rt.block_on(async {
+ println!("performing GET operations");
+ });
+
+ // REMOVE
+ rt.block_on(async {
+ println!("performing REMOVE operations");
+ });
+ })
+ .await
+ .expect("Task panicked");
+
+ Ok(())
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 2, 11:46 AM (13 m, 48 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5879443
Default Alt Text
D4581.1767354386.diff (1 KB)
Attached To
Mode
D4581: [services] Tests - Add performance tests base for Blob
Attached
Detach File
Event Timeline
Log In to Comment