In [1]:
import IPython
IPython.__version__
Out[1]:
In [2]:
import matplotlib
matplotlib.__version__
Out[2]:
In [3]:
import numpy as np
np.__version__
Out[3]:
In [4]:
import simpy
simpy.__version__
Out[4]:
In [5]:
import ultrastorage
ultrastorage.__version__
Out[5]:
In [10]:
# non-reconfigurable simulator
import ultrastorage.simulator.nonreconfigurable as nonreconfigurable
# insertion politics
import ultrastorage.inserter as inserter
# storage system
import ultrastorage.storagesystem as storagesystem
# item generator
import ultrastorage.itemgenerator as itemgenerator
# timout generator
import ultrastorage.timeoutgenerator as timeoutgenerator
# timed item generator
import ultrastorage.timeditemgenerator as timeditemgenerator
# tools
import ultrastorage.tool as tool
In [11]:
name = "myStorageSystem"
number_of_storage_units = 3
capacity = tool.unit.terabyte(1)
cpu = 2
storage_system = storagesystem.homogeneous_storage_system_builder(number_of_storage_units, capacity, cpu, name=name)
print(storage_system)
In [ ]:
simulator = nonreconfigurable.Overflow(storage_system, inserter.FirstFit)
In [ ]:
#
item_generator = itemgenerator.VU2005()
#
timeout_generator = timeoutgenerator.Exponential()
# combine the item generator and the timeout generator
timed_item_generator = timeditemgenerator.TimedItemGenerator(item_generator, timeout_generator)
# let simpy know about this timed item generator
environment.process(timed_item_generator.run(simulator))
In [ ]:
simulator.run()
In [ ]:
for item_event in storage_system.item_event_controller:
print(item_event)
In [ ]:
#snapshots = storage_system.snapshot_controller.snapshots()
for (index, snapshot) in enumerate(storage_system.snapshot_controller):
print("{}: {}\n".format(index+1, str(snapshot)))
In [ ]:
snapshot_reporter = storagesystem.StorageSystemSnapshotReporter(storage_system.snapshot_controller)
In [ ]:
for i, sizes in enumerate(snapshot_reporter.values('size')):
print("{}: {}".format(i+1, sizes))
In [ ]:
for i, size in enumerate(snapshot_reporter.average('size')):
print("{}: {}".format(i+1, size))
In [ ]: