GithubHelp home page GithubHelp logo

zipdeal-llc / django-query-profiler-chrome-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from django-query-profiler/django-query-profiler-chrome-plugin

0.0 0.0 0.0 19 KB

Chrome Plugin for django query profiler

License: BSD 3-Clause "New" or "Revised" License

HTML 19.84% JavaScript 64.59% CSS 15.58%

django-query-profiler-chrome-plugin's Introduction

Django query profiler chrome plugin

https://readthedocs.org/projects/django-query-profiler/badge/?version=latest

This project contains the chrome plugin code for django query profiler - code for which is here, and docs here. The chrome plugin reads the response headers set by the django_query_profiler middleware, and adds the profiled data to a html table in the devtools

Getting Started

Download from chrome webstore

How the code is organized

manifest.json is the entry point for the chrome plugin. It has two important attributes that define how the plugin works:

  1. devtools_page: This extends the browser's built-in devtools by adding another pane
    • we have to specify a html page here, and ours is devtools.html. All this page does is include devtools.js
    • In devtools.js, we have the code to create a devtools panel, and add a listener onRequestFinished. This listener gets called for every api, but acts on it ONLY when the api has the headers it is looking for (which we are setting in the middleware). Once it finds them, it appends a row in the table (in the panel) -- which gets created in next step
  2. options_ui: This specifies the contents of the plugin.
    • This page is defined as panel_table.html. The file panel_table.html contains code to create an empty table. It is in this table that the listener adds rows to
    • We have defined two buttons in the panel - and panel_controls.js defines what functions should be called on button click

For contributors

https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square

The django query profiler chrome plugin is released under the BSD license, like Django itself. If you like it, please consider contributing! How the code is organized, and how the profiler works is documented here in readthedocs

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.