mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
use json lines
This commit is contained in:
parent
a61d8c59ff
commit
dedc91e2cf
@ -1,6 +1,8 @@
|
|||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
|
use serde_json::json;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let input_file = std::env::args_os().nth(1).expect("missing <INPUT> file");
|
let input_file = std::env::args_os().nth(1).expect("missing <INPUT> file");
|
||||||
let input =
|
let input =
|
||||||
@ -11,6 +13,9 @@ fn main() {
|
|||||||
output_file.push("callstats-");
|
output_file.push("callstats-");
|
||||||
output_file.push(input_file);
|
output_file.push(input_file);
|
||||||
let mut output_file = std::io::BufWriter::new(std::fs::File::create(output_file).unwrap());
|
let mut output_file = std::io::BufWriter::new(std::fs::File::create(output_file).unwrap());
|
||||||
serde_json::to_writer(&mut output_file, &profile).unwrap();
|
for (key, value) in profile {
|
||||||
|
serde_json::to_writer(&mut output_file, &json!({key: value})).unwrap();
|
||||||
|
writeln!(&mut output_file).unwrap();
|
||||||
|
}
|
||||||
output_file.flush().unwrap();
|
output_file.flush().unwrap();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user