Coder Social home page Coder Social logo

badoo / liveprof-ui Goto Github PK

View Code? Open in Web Editor NEW
126.0 8.0 19.0 2.98 MB

An aggregator and web interface for Live Profiler

Home Page: http://liveprof.org/

License: MIT License

PHP 62.79% Perl 4.29% Dockerfile 0.08% Shell 0.01% Hack 0.16% CSS 0.91% JavaScript 31.76%
php performance profiler xhprof gui docker aggregator

liveprof-ui's Introduction

Live Profiler UI

logo

Live profiler is a system-wide performance monitoring system in use at Badoo that is built on top of XHProf or its forks (Uprofiler or Tideways). Live Profiler continually gathers function-level profiler data from production tier by running a sample of page requests under XHProf.

Live profiler UI aggregates the profile data corresponding to individual requests by various dimensions such a time, memory usage, and can help answer a variety of questions such as: What is the function-level profile for a specific page? How expensive is function "foo" across all pages, or on a specific page? What functions regressed most in the last day/week/month? What is the historical trend for execution time of a page/function? and so on.

You can find the full documentation in Live Profiler UI wiki

Here is a plugin for PhpStorm to see the method performance directly in IDE.

Build Status GitHub release codecov Scrutinizer Code Quality GitHub license

System Requirements

  • PHP version 7.3 or later to use web interface and run aggregation scripts.
  • PHP version 5.4 or later / hhvm version 3.25.0 or later to collect profiles using Live Profiler
  • Connection to database with profiling result. You can collect profiles using Live Profiler tool
  • Database extension (mysqli, pgsql, sqlite support included)
  • Perl for flame graph functionality

Key features

  • Get stats of average value, minimum, maximum, 95 percentile of execution time, cpu time, memory usage and calls count. Parameter list and statistics functions are configurable.
  • Graphs for every collected parameter and every method up to 6 months. Each graph also includes children stats. It helps to see the history of changes.
  • Differences interface to compare a particular request for two dates and see what became worse.
  • See flame graph of the aggregated request.
  • Get list of requests where a method was called last time. It may be helpful for refactoring purposes and find unused methods.
  • Get the most changed methods in any requests for two dates, for example, today and a week ago. It can help to find a place of a potential performance problem.

Work flow

Live Profiler has 3 main parts:

  1. Profiler
  2. Aggregator
  3. Web interface

License

This project is licensed under the MIT open source license.

liveprof-ui's People

Contributors

ay-bmbl avatar grebenschikov avatar larrabee avatar lebedevsky avatar masterjus avatar schneiderl avatar serderovsh avatar shagtv avatar slach avatar vkazanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

liveprof-ui's Issues

Typo in aggregator command

/usr/local/bin/php /app/bin/cli.php aggregator:aggregate-manual app label YYYY-MM-DD
should actually be:
/usr/local/bin/php /app/bin/cli.php aggregator:aggregate-manual label app YYYY-MM-DD
label goes first as it is a required argument

Aggregator halt

Moved from: badoo/liveprof#4

--

Describe the bug
This command runned from cron script:

AGGREGATOR_CONFIG_PATH=/app/docker/php/liveprof.generated.yaml php /app/tools/liveprof-ui/bin/cli.php cron:process-aggregating-jobs

and script fail with error

Fatal error: Uncaught TypeError: rtrim() expects parameter 1 to be string, null given in /app/tools/liveprof-ui/src/Badoo/LiveProfilerUI/Aggregator.php:268
Stack trace:
#0 /app/tools/liveprof-ui/src/Badoo/LiveProfilerUI/Aggregator.php(268): rtrim(NULL, ',')
#1 /app/tools/liveprof-ui/src/Badoo/LiveProfilerUI/Aggregator.php(250): Badoo\LiveProfilerUI\Aggregator->aggregateRow(Array)
#2 /app/tools/liveprof-ui/src/Badoo/LiveProfilerUI/Aggregator.php(189): Badoo\LiveProfilerUI\Aggregator->aggregate()
#3 /app/tools/liveprof-ui/src/Badoo/LiveProfilerUI/ConsoleCommands/ProcessAggregatingJobsCommand.php(60): Badoo\LiveProfilerUI\Aggregator->process()
#4 /app/tools/liveprof-ui/vendor/symfony/console/Command/Command.php(255): Badoo\LiveProfilerUI\ConsoleCommands\ProcessAggregatingJobsCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /app/tools/liveprof-ui/vendor/symfony/console/Application.php(934): Symfony\Component\Console\Command\Command->run(Object(Symfo in /app/tools/liveprof-ui/src/Badoo/LiveProfilerUI/Aggregator.php on line 268

Expected behavior
Script is working

Additional context
Current state of aggregator_jobs table

select status, count(*)
from aggregator_jobs
group by status

This numbers not changing:

[
  {
    "status": "finished",
    "count(*)": 57
  },
  {
    "status": "new",
    "count(*)": 318
  },
  {
    "status": "processing",
    "count(*)": 19
  }
]

How to aggregate via xhprof_samping_enable?

Dear authors LiveProf, thanks you for your efforts
I think use xhprof_enable() as default callstack tracing method have not enough accurancy and require much CPU resources

i realized some custom Liveprof usage via xhprof_sample_enable + xhprof_sample_disable

https://github.com/Slach/howto-sample-profiling-and-flamegraph/blob/master/php/fpm/conf.d/liveprof_sampling.php

it's work with much lower CPU usage and can used for every php request

but when Liveprof work fine, Liveprof-UI aggregate result which not macth what i see in database
please see sql dump with details
https://mega.nz/#!OIpCTCSa!xGfjWqBM55yDoA0yO5iSvpoKoISICC5TbYL4AAzD4g0

Could you explain me why some additional info from details (like SQL queries) haven't parsed?

Place aggregator_processor.lock file in custom folder

Hello! In file src/Badoo/LiveProfilerUI/ConsoleCommands/ProcessAggregatingJobsCommand.php at line 31:
$lock_filename = '/tmp/aggregator_processor.lock';
Would be great to change hardcoded/tmp destination folder by setting it in src/config/aggregator_services.yaml config file, or using system/php variables (like TMP, TMPDIR or TEMP). That's important when i need 2 instances of liveprof/liveprof-ui on same host without docker.

Tnx for this usefull tool!

UPD: same in tests/unit/Badoo/LiveProfilerUI/LoggerTest.php, but i'm not using it =)

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.