Giter Site home page Giter Site logo

memorytrickster's Introduction

Build Status codecov Version Platform License

Banner

Memory Trickster

Accuracy

What's Memory Trickster?

Memory Trickster is a tool which enables you controlling the memory usage of your device. The point here is not to get limited to a memory warning but indeed fill the memory with fake content achieving real world scenarios (famous corner cases).

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

MemoryTrickster is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MemoryTrickster'

Usage

It's really simple to get start with Memory Trickster. After the instalation, you just need to import Memory Trickster and run it.

MemoryOrchestrator.shared.run()

The tool acts continuosly tracking the top view controller and keeping the itself over it. If you want to customize the pooling timer, you can also instantiate the orchestrator using the factory,

let orchestrator = MemoryTricksterFactory.makeOrchestrator(with: 0.5)
orchestrator.run()

With the tool on, you still have some hide quick actions.

Pressing the green injected view, you'll get a dialog providing you the possibility to clear the memory buffer and close the tool as well.

We're currently supporting all iPhone sizes and orientations

Sizes Orientation

Do not want to use the UI?

If you want to build automated tests, or something which fits better to your context, you would like to play with the memory bridge interface

public typealias MemoryResult = Result<Memory, MemoryError>

public struct Memory {
    public let remaining: Int64
    public let used: Int64
    public let injected: Int64
}

public protocol MemoryBridgeInterface {
    func getMemoryDetails(completion: (MemoryResult) -> ())
    func injectBytes(_ bytes: Int)
    func removeBytes(_ bytes: Int)
    func clearMemory()
}

To get a memory bridge instance, just use

let memoryBridge = MemoryTricksterFactory.makeMemoryBridge()

Contributors

The tool is a current v0, a lot to improve and needed work in order to achieve a great result, all contributions are welcome 🙏

🇧🇷 - Victor Panitz Magalhães

License

MemoryTrickster is available under the MIT license. See the LICENSE file for more info.

memorytrickster's People

Contributors

victorpanitz avatar

Stargazers

Paolo Prodossimo Lopes avatar Marius Rackwitz avatar Fernando Ferreira avatar Douglas Ferreira avatar Eduardo Bocato avatar Michel Anderson Lütz Teixeira avatar Henrique Morbin avatar Pietro Caselani avatar Fabricio Serralvo avatar SPT avatar

Watchers

James Cloos avatar Charles avatar Rafael Machado avatar  avatar

Forkers

taleslemes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.