refactor(comments): Added comments to explain the different example simulation configurations

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2024-12-12 22:15:58 +01:00
parent d5d163f098
commit 910a5c9233

View File

@@ -424,6 +424,8 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# Simulate with a Cache that does random evictions, We'll have 100 Database Objects and a Cache Size of 10\n",
"# We'll generate lambdas from a zipf distribution\n",
"# config = RandomEvictionSimulation(100, 10)\n", "# config = RandomEvictionSimulation(100, 10)\n",
"# config.generate_objects()" "# config.generate_objects()"
] ]
@@ -435,6 +437,8 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# Simulate with a Cache that does lru, We'll have 100 Database Objects and a Cache Size of 10\n",
"# We'll generate lambdas from a zipf distribution\n",
"# config = LRUSimulation(100, 10)\n", "# config = LRUSimulation(100, 10)\n",
"# config.generate_objects()" "# config.generate_objects()"
] ]
@@ -446,6 +450,8 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# Simulate with a Cache that does Refreshes with TTL based eviction, We'll have 100 Database Objects and a Cache Size of 10\n",
"# We'll generate lambdas from a zipf distribution. Each object will have a fixed ttl of 1 when its pulled into the cache. Mu for the refresh rate is 10\n",
"# config = RefreshSimulation(100, 80)\n", "# config = RefreshSimulation(100, 80)\n",
"# config.generate_objects(1, 10)" "# config.generate_objects(1, 10)"
] ]
@@ -457,6 +463,8 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# Simulate with a Cache that does TTL based eviction, We'll have 100 Database Objects and a Cache Size of 10\n",
"# We'll take lambdas from the \"lambda\" column of the file \"../calculated.csv\" and the TTLs for each object from the \"optimal_TTL\" column of the same file.\n",
"config = TTLSimulation(100, 10)\n", "config = TTLSimulation(100, 10)\n",
"config.from_file(\"../calculated.csv\", \"lambda\", \"optimal_TTL\")" "config.from_file(\"../calculated.csv\", \"lambda\", \"optimal_TTL\")"
] ]