Git Product home page Git Product logo

activitykit's Introduction

ActivityKit

ActivityKit provides macOS system information.

  • CPU usage
  • Memory performance
  • Battery state
  • Disk capacity
  • Network connection

This framework is written in Swift 5.

Installation

ActivityKit supports CocoaPods and Swift Package Manager.

Usage

import ActivityKit

// get all statistics per 3 seconds
let observer = ActivityObserver()
observer.updatedStatisticsHandler = { observer in
    Swift.print(observer.statistics)
}
observer.start(interval: 3.0)

// finish to get statistics
observer.stop()

Sample Output

☆☆☆☆☆☆☆☆☆☆ ActivityKit Stats ☆☆☆☆☆☆☆☆☆☆
CPU
    Usage: 17.7%
    System: 4.3%
    User: 13.4%
    Idle: 82.3%
Memory
    Performance: 61.1%
    Pressure: 15.3%
    App: 14.7 GB
    Wired: 2.5 GB
    Compressed: 2.4 GB
Battery
    Charged: 100.0%
    Power Source: Unknown
    Max Capacity: 100.0%
    Cycle: 3
    Temperature: 30.3°C
Disk
    Capacity: 27.3%
    Total: 494.4 GB
    Free: 359.4 GB
    Used: 135.0 GB
Network
    Name Wi-Fi
    Local IP: xx.x.x.xx
    Upload: 10.3 KB/s
    Download: 6.3 KB/s
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆

Copyright and License

Copyright 2020 Takuto Nakamura

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

activitykit's People

Contributors

kyome22 avatar

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.