123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134(*
* Copyright (c) 2018-2022 Tarides <contact@tarides.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)moduleConfig=structtype_return_type=|Unit:unitreturn_type|Summary:Trace_stat_summary.treturn_typetype'aconfig={number_of_commits_to_replay:int;path_conversion:[`None|`V1|`V0_and_v1|`V0];inode_config:int*int;store_type:[`Pack|`Pack_layered|`Pack_mem];replay_trace_path:string;artefacts_path:string;keep_store:bool;keep_stat_trace:bool;empty_blobs:bool;return_type:'areturn_type;gc_every:int;gc_distance_in_the_past:int;gc_wait_after:int;add_volume_every:int;}(** Replay configuration
[replay_trace_path] points to a specific file that describes the sequence
of operations to replay. You may download one of the following URLs. The
smaller ones are prefix of the larger ones.
- http://data.tarides.com/irmin/data4_10310commits.repr (0.3GB)
- http://data.tarides.com/irmin/data4_100066commits.repr (2.9GB)
- http://data.tarides.com/irmin/data_1343496commits.repr (102GB)
[number_of_commits_to_replay] is the wished number of commits to replay.
If the value is too high, the replay will stop when reaching the end of
[replay_trace_path]. Pick a number of commits depending on the wished
runtime. Here are some reference runtimes that were true for irmin 3.0:
- [60_457] commits take 3 minutes
- [500_000] commits take 1 hour
- [1_343_496] commits take 5 hours
[artefacts_path] is the destination for the stats trace and the store. If
both [keep_store] and [keep_stat_trace] are false, the destination will be
emptied at the end of the replay.
[path_conversion] is the strategy for shortening the paths while
replaying. Was useful when benchmarking irmin on flattened Tezos paths.
[empty_blobs] make the replay to push the empty string as in all the
blobs, instead of their actual value read in the trace.
[inode_config] is a pair of ints that will be stored in the results of the
replay.
A GC is triggered every [gc_every] commits. When GC is triggered, we
select a previous commit that is [gc_distance_in_the_past] commits away
from the current head commit.
The first GC will be started after [gc_distance_in_the_past + 1] commits
were replayed. [gc_distance_in_the_past] only makes sense if [gc_every] is
not [0].
[gc_wait_after] defines how many commits separate the start of a GC and
the moment we block to wait for it to finish. [0] means that we will only
block when the next gc starts or at the end of the replay. This parameter
only makes sense if [gc_every] is not [0]. *)endmoduletypeConfig=moduletypeofConfigincludeConfigmoduletypeStore=sigtypestore_configtypekeyincludeIrmin.Generic_key.KVwithtypeSchema.Contents.t=bytesandtypecommit_key=keyandtypenode_key=keyandtypecontents_key=keytypeon_commit:=int->Hash.t->unitLwt.ttypeon_end:=unit->unitLwt.tvalcreate_repo:root:string->store_config->(Repo.t*on_commit*on_end)Lwt.tvalsplit:repo->unitvaladd_volume:repo->unitvalgc_wait:repo->unitLwt.ttypestats:=Irmin_pack_unix.Stats.Latest_gc.statsvalgc_run:?finished:((stats,string)result->unitLwt.t)->repo->commit_key->unitLwt.tendmoduletypeSigs=sigincludeConfigwithtype'areturn_type='areturn_typeandtype'aconfig='aconfigmoduletypeStore=StoremoduleMake(Store:Store):sigincludeConfigwithtype'areturn_type='areturn_typeandtype'aconfig='aconfigvalrun:Store.store_config->'aconfig->'aLwt.tendend