Giter Site home page Giter Site logo

cargo-samply's Introduction

Cargo Samply

Continuous integration

a simple integration binary that automates the process of running cargo build with a certain profile and samply afterwards. It installs samply if it is not available using cargo install.

Installation

for now you can install it from crates.io or directly from github.com

# crates.io
cargo install cargo-samply
# or from git
cargo install --git https://github.com/PhilippPolterauer/cargo-samply.git

Example Usage

The usage is quite simple

$ cargo new mybinary
$ cd mybinary
$ cargo samply
cargo.toml: ~/rust/mybinary/Cargo.toml
'samply' profile was added to 'Cargo.toml'
   Compiling mybinary v0.1.0 (~/rust/mybinary)
    Finished samply [optimized + debuginfo] target(s) in 0.18s
Hello, world!
Local server listening at http://127.0.0.1:3001

when opening the server address (127.0.0.1:3001) the output should look like the following. Samply Web View

Advanced Usecases with custom arguments

there is a test package at test/testpackage/ which can be used for highlighting the following options.

cargo-samply respects the default-run argument:

$ cargo samply
running 'cargo locate-project'
cargo.toml: /home/philipp/rust/cargo-samply/tests/testpackage/Cargo.toml
running 'cargo build --profile samply'
running 'samply record target/samply/main'

cargo-samply can be targeted at certain binaries e.g. --example

$ cargo samply --example hello
running 'cargo locate-project'
cargo.toml: /home/philipp/rust/cargo-samply/tests/testpackage/Cargo.toml
running 'cargo build --profile samply --example hello'
running 'samply record target/samply/examples/hello'

or --bin

$ cargo samply --bin another
running 'cargo locate-project'
cargo.toml: /home/philipp/rust/cargo-samply/tests/testpackage/Cargo.toml
running 'cargo build --profile samply --bin another'
running 'samply record target/samply/another'

additional arguments can be passed after --

$ cargo samply --bin another -- 'new text'
running 'cargo locate-project'
cargo.toml: /home/philipp/rust/cargo-samply/tests/testpackage/Cargo.toml
running 'cargo build --profile samply --bin another'
running 'samply record target/samply/another "new text"'
Hello, new text!

cargo-samply's People

Contributors

philipppolterauer avatar glehmann avatar

Watchers

 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.