• Stars
    star
    561
  • Rank 79,400 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Distributed profiling on the cheap

This is a collection of minimalist utilities for profiling Python programs. The motivation behind them is described in our blog post.

py2devtools

The profile visualizer that's built into the Chrome developer tools is pretty rad. py2devtools.py contains instrumentation to create a .cpuprofile file from a Python program that can be loaded into the developer tools. See the module docstring for details.

stacksampler

stacksampler.py contains a sampling profiler, along with a minimal embedded HTTP server to expose its data. It's built to work with gevented applications, but can be adapted to work without. Assuming gevent, drop

import stacksampler
gevent.spawn(stacksampler.run_profiler)

into your code, run your application, and then do

curl localhost:16384

to get profiling data. See the module docstring for more details.

The stackcollector agent

Screenshot

The stackcollector package adds basic support for automatically collecting and visualizing profiles from distributed processes. It has two parts: a long-running collector agent that periodically gets samples from processes, and a frontend that serves visualizations. Data is timestamped and persisted using gdbm, allowing for time-based querying.

Installation

# create a directory for data files
sudo mkdir -p /var/lib/stackcollector
sudo chmod a+rw /var/lib/stackcollector

virtualenv .
source bin/activate
python setup.py install

Running the collector

The collector assumes that processes expose profiles in the flamegraph line format over HTTP, as implemented by stacksampler.py.

# Every minute, gather stacks from a local process listening on port 16384.
python -m stackcollector.collector --host localhost --ports 16384 --interval 60

Running the visualizer

python -m stackcollector.visualizer --port 5555

Then visit e.g. http://localhost:5555?from=-15minutes to see data from the past 15 minutes.

Questions? Issues?

Don't hesitate to get in touch!

More Repositories

1

nylas-mail

πŸ’Œ An extensible desktop mail app built on the modern web. Forks welcome!
JavaScript
24,808
star
2

sync-engine

πŸ“¨ IMAP/SMTP sync system with modern APIs
Python
3,503
star
3

make-deb

Tool for building debian packages from your python projects
Python
295
star
4

inbox-ios

Inbox.framework for iOS and related examples, sample code, and documentation
Objective-C
183
star
5

component-store-example

An example of the topics covered in Building for Plugins with React & Flux
CoffeeScript
180
star
6

ansible-test

An Ansible Testing Framework for Humans
Python
172
star
7

nylas-nodejs

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.
TypeScript
169
star
8

inbox.js

Client-side SDK for communicating with the InboxApp API
JavaScript
141
star
9

inbox-scaffold-html5

The Inbox HTML5 App Scaffold - a foundation for building great mail apps.
CoffeeScript
127
star
10

nylas-mail-theme-starter

A basic starter for any theme you want to create for N1.
CSS
101
star
11

nylas-python

Python bindings for the Nylas Platform API
Python
101
star
12

nylas-ruby

Ruby bindings for the Nylas Platform APIs
Ruby
101
star
13

inbox-scaffold-ios

iOS App Scaffold
JavaScript
100
star
14

components

UI building blocks to add email, calendar, and contacts to your app in minutes.
Svelte
90
star
15

electroplate

Automatic desktop integrated webapps via Electron
JavaScript
77
star
16

exchangelib

Python client for Microsoft Exchange Web Services (EWS)
Python
67
star
17

N1-Markdown-Composer

An N1 plugin to write emails using markdown
CoffeeScript
65
star
18

nylas-java

Nylas Java SDK
Kotlin
30
star
19

sync-engine-docker

[deprecated] Utilities to run the sync engine under Docker
Shell
25
star
20

mypy-tools

A handful of tools for using mypy
Python
24
star
21

ansible-flask-example

Example using ansible-test and wrapper roles to implement a simple flask webapp
Python
24
star
22

electron-RxDB

RxDB is a high-performance, observable object store built on top of SQLite & intended for database-driven Electron applications.
JavaScript
24
star
23

build-dpkg-buster

GitHub Action for building Debian packages on Buster
Dockerfile
19
star
24

nylas-production-python

Utilities for running Python code in production
Python
18
star
25

nylas-php

PHP
18
star
26

imap-provider-settings

Common IMAP provider settings
JavaScript
15
star
27

scheduler-examples

Example code for the Nylas Scheduler
HTML
15
star
28

inbox-zero

Automate Your Way to Inbox Zero With Nylas
JavaScript
11
star
29

flask-statsd

Flask Extension for statsd integration
Python
8
star
30

use-cases

Explore Nylas API through demo apps with your preferred backend and frontend frameworks.
JavaScript
8
star
31

nodejs-sample-process-all-mail

An example of a NodeJS application that processes all existing and incoming email messages in connected accounts.
JavaScript
6
star
32

paper-reading-group

CSS
6
star
33

nylas-api-demo

An example application that consumes the Nylas API.
JavaScript
5
star
34

slackbot

scheduler slack bot tutorial
Shell
5
star
35

nylas-mail-docs

Docs for the Nylas Mail project
5
star
36

tessera-up

Dashboard generator for Tessera
Python
3
star
37

imapclient-unparented

Python
3
star
38

build-dpkg-stretch

GitHub Action for building Debian packages on Stretch
Dockerfile
3
star
39

caldav

clone of hg repo for PyPI caldav
Python
2
star
40

webhooks-server

This is a small repo on how to create webhooks-server for you Nylas applications in the cloud (Heroku)
JavaScript
2
star
41

nylas-js

JavaScript SDK for the Nylas Platform API
TypeScript
1
star
42

.github

1
star
43

homebrew-nylas-cli

Ruby
1
star
44

data-streams-looker-block

Testing looker blocks
LookML
1
star
45

uprocket-demo

UpRocket Demo of Nylas Scheduler v3
TypeScript
1
star