humitos
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # KPI's for EmbedAPI and sphinx-hoverxref _(draft of work for this task https://trello.com/c/R1XrXxwm/868-create-kpis-for-user-base-of-embed-api-api-calls-hoverxref-dependents)_ * How many projects are using the Embed API? * We are _not_ logging good responses from `embed/v3/views.py` (eg. `log.info("Success. project= url= referer= user-agent=")`) * We are not sending NGINX logs to util01, so we don't have history --only the current day per instance * APIv3 `grep "/api/v3/embed/" /var/log/nginx/readthedocs-api.log | cut -d " " -f 8,12 | less` gives us the EmbedAPI URL + the referer * APIv3 `grep "/api/v3/embed/" /var/log/nginx/readthedocs-api.log | cut -d " " -f 12 | sort | uniq | wc -l` gives us how many URLs are using EmbedAPI * APIv2 `grep "/api/v2/embed/" /var/log/nginx/readthedocs-api.log | cut -d " " -f 8 | cut -d "&" -f 1 | sort | uniq | less` show projects using the EmbedAPI > some of these logs are saved into readthedocs@util01(org):~/embedapilogs * How many projects are using Hoverxref? * Currently, we don't have an exact way to know this. There was an attempt to collect this type of data already in https://github.com/readthedocs/readthedocs.org/pull/8124 (telemetry) * Dependents analysis: * 147 projects are using it from https://github.com/readthedocs/sphinx-hoverxref/network/dependents * Those 147 projects include several forks * 3 dependent packages and 1 dependent repository according to https://libraries.io/pypi/sphinx-hoverxref * Note there is no way to differentiate a request comming from a random page that one coming from sphinx-hoverxref. _We need to add some specific User-Agent or similar in our client_. * What is the rate of change of adoption of these projects? ---- # EmbedAPI's and sphinx-hoverxref's data Instead of using `log.info` to acummulate data in logs, we could use the same implementation's idea from "Build's data" by triggering Celery tasks and strore structured data using a different database. ## Structure ```yaml= embed: api: date: url: full: query: doctool: doctoolversion: referer: user-agent: http-status-code: project: id: slug: organization: id: slug: version: id: slug: language: user: id: username: ``` ## Questions * What projects are hitting rate limit? * What projects use EmbedAPI? * How many projects use EmbedAPI via `sphinx-hoverxref`? * How many projects are using APIv3/APIv2? * How many projects use `doctoolversion==1.8.x`? ---- # Build's data _(based on https://github.com/readthedocs/readthedocs.org/pull/8124/)_ Having a complete structure of build's data will allow us to answer several questions that will help us to make bussiness decisions. ## Structure ```yaml= build: id: date: length: success: project: id: slug: organization: id: slug: version: id: slug: config: user: final: packages: user: pip: conda: nodejs: apt: final: pip: conda: os: python: ``` ## Questions * How much build time a particular project is using in a date range? * How much build time a particular organization is using in a date range? * How many projects are installing `sphinx-hoverxref`, and which of them are using a specific version? * What projects are using `sphinx<=1.8.x`? * How many builds using `sphinx<=1.8.x` have failed in the last 2 weeks? * How many projects are using the new `build.tools` config? * What projects would require `USE_LATEST_SPHINX` feature flag due that their builds are failing because of `docutils==0.18` release? * How many projects have tunned configuration for search (eg. `search.ranking`)? * How many projects have enabled PDF output? * How many projects use Conda compared to pip? ## Implementation Once the build is finished, we can trigger a Celery task to be executed in a particular queue `telemetry` that gather(*) all of this information from the `Build` object (using the default database) and dumps it into a new database used specifically for this purpose (with _real_ JSON fields). _(*) we could call the Celery task passing all the data or we can parse the build's output when the task is executed._ ## Querying data Once we have this data stored in a PostgreSQL database, we can just use django's shell for quick queries or we can integrate both databases with Metabase to have nice real-time graph. Besides, we could also just do an SQL dump (or directly connect to production database) and analyze it using a Jupyter Notebook for a more extensive work. # Plan to action 1. ~~add User-Agent to sphinx-hoverxref and make a new release~~ 2. ~~add `log.info` to EmbedAPI Python view~~ > at this point we will start collecting at least some small data about EmbedAPI that we can parse/view from Read the Docs' application logs 3. ~~Migrate to Django 3.2 (https://www.djangoproject.com/weblog/2021/apr/06/django-32-released/)~~ 4. ~~(optional) migrate current JSONFields for PostgreSQL built-in~~ 5. create new db for `telemetry` 6. dump data into new db using Celery tasks triggered by EmbedAPI Python view 7. (optional) implement build's telemetry ## Concerns about this plan - Builders do not have access to the db. So, they will need to trigger a task once the build have finished passing all the data to be executed on webs that have access to the db, and store the data - Metabase does not natively support PostgreSQL JSONb type (see https://github.com/metabase/metabase/issues/708) - there is a comment that says what we need (I think) it's supported, tho. https://github.com/metabase/metabase/issues/708#issuecomment-375042214 - creating a view is a current workaround, since Metabase see it as a regular table; it doesn't make too much sense for data that's too nested, tho - maybe consider using MongoDB which is natively supported by Metabase? (https://www.metabase.com/docs/latest/administration-guide/databases/mongodb.html)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully