Skip to content

JiaeK/Outreachy-internship-for-OCaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 

Repository files navigation

🐫 Documentation of my Outreachy internship working with OCaml 🐫

🪧 Table of Contents



📣 General info

  • Project’s name: Building a monitoring and analytics dashboard for OCaml.org

  • Purpose: Providing visibility on server performance and usage to OCaml.org users (metrics, statistics, analytics)

  • Mentor: Thibaut Mattio (@tmattio)

📣 Source links



🌈 Features

  • Checked box means implemented feature, ___ means implemented & actually upstreamed feature (at the time of the PR)
Overview page Analytics page Monitoring page Logs page
  • Version of OCaml
  • Version of Dream
  • Version of the dashboard
  • Uptime
  • Host system information (OS, architecture, etc.)
  • Number of visitors
  • Top countries
  • Top sources
  • Top pages
  • Devices
  • Browsers
  • Operating system
  • Memory usage
  • CPU usage
  • Opened file descriptors
  • Total I/O (input and output measured in Gb)
  • Report logs


🧭 Overview of workflow & pair programming

🔹Overview of workflow as in chart

Workflow overview chart


🔹Table of pair programming notes and workflow

Before - Get familiarise with mirage-metrics (CPU, memory), Study & reference Phoenix.LiveDashboard

Pair programming #1 - Basic concepts of OCaml, How to reference OCaml API when writing OCaml, OCaml syntax

Pair programming #2 - Uptime, Returning to CPU, metrics-lwt

Pair programming #3 - Get familiarise with Dream, Implement a spin-dream project, How to reference build_info, alcotest

Pair programming #4 - Implement platform & CPU & uptime, Learn about Luv & ocaml-node-unix & I/O & mutex

Pair programming #5 - user agent, os, device info, events

Pair programming #6 - Revision, Refactoring

Pair programming #7 - top browser, top os, top devices, CPU usage & Started working with UI designers

Pair programming #8 - load average, memory usage, opened file descriptors, Started researching dashboard designs

Pair programming #9 - Attempt to implement log

Pair programming #10 - unique visitors, Adjust `open file descriptors, Get localization for IP addresses, Hash

Pair programming #11 - Temporary remove log, Get ready for upstreaming - opened PR for integration to ocaml.org , adjust TODOs

Pair programming #12 - Rebase, Add the total count of unique visitors, Fix memory usage & uptime, Remove I/O for now

Pair programming #13 - Aggregate, Make it more reponsive, Remove unuse code for now

Pair programming #14 - Rebase, Update privacy policy, Check everything before go upstream, Open an issue for the next steps



🗺️ Planned outlook

Disclaimer: this UI design and all the foundations of back-end code exist inside of the repo, but the actual outlook when the PR was merged is different as shown in the next paragraph

🔹Overview page

dash o

🔹Monitoring page

dash m

🔹Analytics page

dash a1 dash a2



📈 Outlook (when the PR was merged)

🔹Overview page

dashboard overview 3 25 2022

🔹Analytics page

dashboard analytics 3 25 2022



🔧 Developed with

  • OCaml : A functional, statically-typed programming language from the ML family, offering a powerful module system extending that of Standard ML and a feature-rich, class-based object system
  • Dune : A build system designed for OCaml/Reason projects
  • Dream : Easy-to-use, feature-complete Web framework without boilerplate
  • crunch : Convert a filesystem into a static OCaml module
  • dune-build-info : Embed build informations inside executable
  • luv : A neatly-packaged OCaml/Reason binding to libuv, the cross-platform C library that does asynchronous I/O in Node.js and runs Node's main loop
  • metrics-lwt : Lwt backend for the Metrics library
  • user-agent-parser : OCaml implementation of the user agent parse rules of uap-core
  • digestif : Hash algorithms in C and OCaml (SHA*, RIPEMD160, BLAKE2* and MD5)
  • alcotest : A lightweight and colourful test framework that exposes a simple interface to perform unit tests
  • odoc : OCaml documentation generator
  • ppx_deriving_yojson : A plugin that generates JSON serializers and deserializes that use the Yojson library from an OCaml type definition
  • yojson : JSON library for OCaml
  • timedesc : OCaml date time handling and reasoning suite
  • Tailwind CSS : A utility-first CSS framework for rapidly building custom user interfaces
  • Alpine.js: A rugged, minimal framework for composing JavaScript behavior in your markup


Acknowlegdement

  • This project is inspired by Phoenix.LiveDashboard and plausible.io
  • UI design by Asaad Mahmood
  • 📺 Watch the final public presentation I organised & hosted with my amazing fellow interns: here
  • 📰 Read more stories of my Outreachy internship experience on my blog

About

Documentation of my Outreachy internship for ocaml.org (21' -22')

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published