summaryrefslogtreecommitdiff
path: root/opendc-simulator
AgeCommit message (Collapse)Author
2021-10-03refactor(simulator): Create separate callbacks for remaining eventsFabian Mastenbroek
This change creates separate callbacks for the remaining events: onStart, onStop and onConverge.
2021-10-03refactor(simulator): Remove capacity eventFabian Mastenbroek
This change removes the Capacity entry from FlowEvent. Since the source is always pulled on a capacity change, we do not need a separate event for this.
2021-10-03refactor(simulator): Remove failure callback from FlowSourceFabian Mastenbroek
This change removes the `onFailure` method from FlowSource. Instead, the FlowConsumer will receive the reason for failure of the source.
2021-10-03perf(simulator): Manage flow connection timers more efficientlyFabian Mastenbroek
This change reduces the number of operations necessary to manage the timers of a flow connection.
2021-10-03perf(simulator): Do not use set for tracking convergenceFabian Mastenbroek
This change removes the use of a HashSet for tracking the flow connections that can converge. A HashSet requires an allocation for every addition, which caused a significant overhead. The new approach using an ArrayDeque should not allocate any memory.
2021-10-03refactor(simulator): Separate push and pull flagsFabian Mastenbroek
This change separates the push and pull flags in FlowConsumerContextImpl, meaning that sources can now push directly without pulling and vice versa.
2021-10-03refactor(simulator): Migrate to flow-based simulationFabian Mastenbroek
This change renames the `opendc-simulator-resources` module into the `opendc-simulator-flow` module to indicate that the core simulation model of OpenDC is based around modelling and simulating flows. Previously, the distinction between resource consumer and provider, and input and output caused some confusion. By switching to a flow-based model, this distinction is now clear (as in, the water flows from source to consumer/sink).
2021-10-03refactor(simulator): Remove transform from SimResourceForwarderFabian Mastenbroek
This change removes the ability to transform the duration of a pull from the SimResourceForwarder class. This ability is not used anymore, since pushes are now done using a method instead of a command.
2021-10-03refactor(simulator): Merge distributor and aggregator into switchFabian Mastenbroek
This change removes the distributor and aggregator interfaces in favour of a single switch interface. Since the switch interface is as powerful as both the distributor and aggregator, we don't need the latter two.
2021-10-03refactor(simulator): Eliminate usage of distributor and aggregatorFabian Mastenbroek
This change removes the use of distributor and aggregator from the other OpenDC components. For the future, we focus on maintaining a single SimResourceSwitch implementation to achieve both use-cases.
2021-10-03refactor(simulator): Remove SimResourceFlow interfaceFabian Mastenbroek
2021-10-03refactor(simulator): Do not expose SimResourceStateFabian Mastenbroek
This change hides the SimResourceState from public API since it is not actively used outside of the `SimResourceContextImpl` class.
2021-10-03refactor(simulator): Remove onUpdate callbackFabian Mastenbroek
This change removes the `onUpdate` callback from the `SimResourceProviderLogic` interface. Instead, users should now update counters using either `onConsume` or `onConverge`.
2021-10-03refactor(simulator): Lazily push changes to resource contextFabian Mastenbroek
This change updates the SimResourceContextImpl to lazily push changes to the resource context instead of applying them directly. The change is picked up after the resource is updated again.
2021-10-03refactor(simulator): Invoke consumer callback on every invalidationFabian Mastenbroek
This change updates the simulator implementation to always invoke the `SimResourceConsumer.onNext` callback when the resource context is invalidated. This allows users to update the resource counter or do some other work if the context has changed.
2021-10-03refactor(simulator): Simplify max-min aggregator implementationFabian Mastenbroek
This change simplifies the implementation of the SimResourceAggregatorMaxMin class by utilizing the new push method. This approach should offer better performance than the previous version, since we can directly push changes to the source.
2021-10-03perf(simulator): Reduce memory allocations in SimResourceInterpreterFabian Mastenbroek
This change removes unnecessary allocations in the SimResourceInterpreter caused by the way timers were allocated for the resource context.
2021-10-03refactor(simulator): Add support for pushing flow from contextFabian Mastenbroek
This change adds a new method to `SimResourceContext` called `push` which allows users to change the requested flow rate directly without having to interrupt the consumer.
2021-10-03refactor(simulator): Combine work and deadline to durationFabian Mastenbroek
This change removes the work and deadline properties from the SimResourceCommand.Consume class and introduces a new property duration. This property is now used in conjunction with the limit to compute the amount of work processed by a resource provider. Previously, we used both work and deadline to compute the duration and the amount of remaining work at the end of a consumption. However, with this change, we ensure that a resource consumption always runs at the same speed once establishing, drastically simplifying the computation for the amount of work processed during the consumption.
2021-10-03perf(simulator): Use direct field access for perf-sensitive codeFabian Mastenbroek
This change updates the SimResourceDistributorMaxMin implementation to use direct field accesses in the perf-sensitive code.
2021-10-03test(simulator): Use longer traces for benchmarksFabian Mastenbroek
This change updates the JMH benchmarks to use longer traces in order to measure the overhead of running the flow simulation as opposed to setting up the benchmark.
2021-10-03build: Migrate from kotlinx-benchmark to jmh-gradleFabian Mastenbroek
This change updates the project to use jmh-gradle for benchmarking as opposed to kotlinx-benchmark. Both plugins use JMH under the hood, but jmh-gradle offers more options for profiling and seems to be beter maintained.
2021-09-19refactor(simulator): Remove dependency on SnakeYamlFabian Mastenbroek
This change removes the dependency on SnakeYaml for the simulator. It was only required for a very small component of the simulator and therefore does not justify bringing in such a dependency.
2021-09-17fix(simulator): Support workload/machine CPU count mismatchFabian Mastenbroek
This change allows workloads that require more CPUs than available on the machine to still function properly.
2021-09-17refactor(telemetry): Standardize SimHost metricsFabian Mastenbroek
This change standardizes the metrics emitted by SimHost instances and their guests based on the OpenTelemetry semantic conventions. We now also report CPU time as opposed to CPU work as this metric is more commonly used.
2021-09-10refactor(compute): Integrate fault injection into compute simulatorFabian Mastenbroek
This change moves the fault injection logic directly into the opendc-compute-simulator module, so that it can operate at a higher abstraction. In the future, we might again split the module if we can re-use some of its logic.
2021-09-10feat(simulator): Support generic distribution in fault injectorFabian Mastenbroek
This change adds support for specifying the distribution of the failures, group size and duration for the fault injector.
2021-08-25refactor(compute): Measure power draw without PSU overheadFabian Mastenbroek
This change updates the SimHost implementation to measure the power draw of the machine without PSU overhead to make the results more realistic.
2021-08-25refactor(simulator): Remove usage and speed fields from SimMachineFabian Mastenbroek
This change removes the usage and speed fields from SimMachine. We currently use other ways to capture the usage and speed and these fields cause an additional maintenance burden and performance impact. Hence the removal of these fields.
2021-08-25fix(simulator): Eliminate unnecessary double to long conversionsFabian Mastenbroek
This change eliminates unnecessary double to long conversions in the simulator. Previously, we used longs to denote the amount of work. However, in the mean time we have switched to doubles in the lower stack.
2021-08-25build: Upgrade to OpenTelemetry 1.5Fabian Mastenbroek
This change upgrades the OpenTelemetry dependency to version 1.5, which contains various breaking changes in the metrics API.
2021-08-24feat(simulator): Add support for reporting interfered workFabian Mastenbroek
This change adds support to the simulator for reporting the work lost due to performance interference.
2021-08-24fix(simulator): Support unaligned trace fragmentsFabian Mastenbroek
2021-08-24fix(simulator): Support trace fragments with zero cores availableFabian Mastenbroek
This change fixes an issue with the simulator where trace fragments with zero cores to execute would give a NaN amount of work.
2021-08-24fix(simulator): Record overcommit only after deadlineFabian Mastenbroek
This change fixes an issue with the simulator where it would record overcomitted work if the output was updated before the deadline was reached.
2021-08-24refactor(simulator): Execute traces based on timestampsFabian Mastenbroek
This change refactors the trace workload in the OpenDC simulator to track execute a fragment based on the fragment's timestamp. This makes sure that the trace is replayed identically to the original execution.
2021-08-22refactor(compute): Update FilterScheduler to follow OpenStack's NovaFabian Mastenbroek
This change updates the FilterScheduler implementation to follow more closely the scheduler implementation in OpenStack's Nova. We now normalize the weights, support many of the filters and weights in OpenStack and support overcommitting resources.
2021-08-22perf(simulator): Prevent counter update without workFabian Mastenbroek
This change implements a performance improvement by preventing updates on the resource counters in case no work was performed in the last cycle.
2021-08-13build: Update Kotlin dependenciesFabian Mastenbroek
This change updates the Kotlin dependencies used by OpenDC to their latest version.
2021-06-24simulator: Re-implement performance interference modelFabian Mastenbroek
This change updates reimplements the performance interference model to work on top of the universal resource model in `opendc-simulator-resources`. This enables us to model interference and performance variability of other resources such as disk or network in the future.
2021-06-24simulator: Add interface for resource interferenceFabian Mastenbroek
This change introduces an interface for modelling performance variability due to resource interference in systems where resources are shared across multiple consumers.
2021-06-22simulator: Add support for storage devices (v1)Fabian Mastenbroek
This change adds initial support for storage devices in the OpenDC simulator. Currently, we focus on local disks attached to the machine. In the future, we plan to support networked storage devices using the networking support in OpenDC.
2021-06-22simulator: Add virtual network switchFabian Mastenbroek
This change adds a virtual network switch to the OpenDC networking module. Currently, the switch bridges the traffic equally across all ports. In the future, we'll also add routing support to the switch.
2021-06-22simulator: Add support for attaching network adapter to machineFabian Mastenbroek
This change bridges the compute and network simulation module by adding support for network adapters in the compute module. With these network adapters, compute workloads can communicate over the network that the adapters are connected to.
2021-06-21simulator: Re-organize compute simulator moduleFabian Mastenbroek
This change re-organizes the classes of the compute simulator module to make a clearer distinction between the hardware, firmware and software interfaces in this module.
2021-06-21simulator: Add core module for network simulationFabian Mastenbroek
This change adds a basic framework as basis for network simulation support in OpenDC. It is modelled similarly to the power system that has been added recently.
2021-06-21simulator: Reduce allocations in interpreter hot pathFabian Mastenbroek
This change updates the resources module to reduce the number of object allocations in the interpreter's hot path. This in turn should reduce the GC pressure.
2021-06-21simulator: Optimize flag management of resource contextFabian Mastenbroek
This change optimizes the internal flag management used in the SimResourceContextImpl to use bitwise flags instead of enums. This approach simplifies the implementation immensely and reduces the number of branches.
2021-06-21simulator: Remove concept of resource lifecycleFabian Mastenbroek
This change removes the AutoCloseable interface from the SimResourceProvider and removes the concept of a resource lifecycle. Instead, resource providers are now either active (running a resource consumer) or in-active (being idle), which simplifies implementation.
2021-06-21simulator: Pool update allocations in interpreterFabian Mastenbroek
This change updates the SimResourceInterpreter implementation to pool the allocations of the Update objects. This reduces the amount of allocations necessary in the hot path of the simulator.