mirror of
git://f0xx.org/android_cast
synced 2026-07-29 05:17:39 +03:00
docs and opus/speex submods
This commit is contained in:
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -4,7 +4,7 @@
|
|||||||
branch = main
|
branch = main
|
||||||
[submodule "third-party/opus"]
|
[submodule "third-party/opus"]
|
||||||
path = third-party/opus
|
path = third-party/opus
|
||||||
url = https://github.com/xiph/opus.git
|
url = https://github.com/xiph/opus
|
||||||
[submodule "third-party/speex"]
|
[submodule "third-party/speex"]
|
||||||
path = third-party/speex
|
path = third-party/speex
|
||||||
url = https://github.com/xiph/speex.git
|
url = https://github.com/xiph/speex/
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -98,3 +98,15 @@ Activities bind via AIDL for status and (on the receiver) attaching the video `S
|
|||||||
## Development (git flow)
|
## Development (git flow)
|
||||||
|
|
||||||
Green **`master`** plus integration branch **`next`**. See [docs/GIT_FLOW.md](docs/GIT_FLOW.md).
|
Green **`master`** plus integration branch **`next`**. See [docs/GIT_FLOW.md](docs/GIT_FLOW.md).
|
||||||
|
|
||||||
|
## PDF helpers
|
||||||
|
|
||||||
|
Generate the GraphVis decision memo PDF (from `tmp/GRAFANA_vs_others_graphvis_pivot.md` source):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash scripts/build-graphvis-pdf.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Output:
|
||||||
|
|
||||||
|
`tmp/GRAFANA_vs_others_graphvis_pivot.pdf`
|
||||||
|
|||||||
82
docs/GRAFANA_vs_others_graphvis_pivot.md
Normal file
82
docs/GRAFANA_vs_others_graphvis_pivot.md
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
# Android Cast — Graph Visualization Pivot
|
||||||
|
|
||||||
|
_Date: 2026-06-02_
|
||||||
|
|
||||||
|
## Context and constraints
|
||||||
|
|
||||||
|
- Stack: minimalistic LAMP with nginx + php-fpm + MariaDB.
|
||||||
|
- Main constraint: **no data duplication/ETL pipeline** (no cron-based mirroring or parallel stores).
|
||||||
|
- Need role-hierarchical analytics: user → slug admin → platform admin.
|
||||||
|
|
||||||
|
## Executive summary
|
||||||
|
|
||||||
|
- **Grafana is viable** if it can query MariaDB directly and enforce tenant/role boundaries safely.
|
||||||
|
- **Custom PHP dashboards are safer initially** for auth/session reuse and strict slug scoping.
|
||||||
|
- Recommended approach: **hybrid**.
|
||||||
|
- Define a canonical SQL metrics contract once.
|
||||||
|
- Ship custom BE dashboards first.
|
||||||
|
- Add Grafana later only if direct DB + RBAC integration is clean.
|
||||||
|
|
||||||
|
## Option comparison
|
||||||
|
|
||||||
|
| Option | Pros | Cons / Risks | Stack impact |
|
||||||
|
|---|---|---|---|
|
||||||
|
| Grafana (direct DB) | Fast polished charts, panel ecosystem, alerting | Auth/RBAC integration effort; slug filtering discipline required; one more service to operate | Adds Grafana runtime (no ETL required) |
|
||||||
|
| Custom PHP + nginx | Native shared login/session, direct BE internals, deterministic tenant logic | More UI/chart development effort | No new runtime dependencies |
|
||||||
|
| Hybrid (recommended) | Fast practical delivery + future flexibility | Needs shared metrics contract discipline | Minimal immediate risk |
|
||||||
|
|
||||||
|
## Role-based graph packs (suggested)
|
||||||
|
|
||||||
|
### User graphs
|
||||||
|
|
||||||
|
- Unique devices per day (registrations/device IDs).
|
||||||
|
- Avg cast duration by day/week.
|
||||||
|
- Avg receive sessions by day/week.
|
||||||
|
- Success ratio (session start vs completed).
|
||||||
|
- App version distribution.
|
||||||
|
|
||||||
|
### Slug admin graphs
|
||||||
|
|
||||||
|
- Everything from user level, aggregated by slug.
|
||||||
|
- Active vs passive users/devices.
|
||||||
|
- Avg app bandwidth (send/recv) in 1d/7d windows.
|
||||||
|
- Install source pie: Play Market vs OTA vs custom.
|
||||||
|
- NTP/time-source usage split and correction savings metric.
|
||||||
|
|
||||||
|
### Platform admin graphs
|
||||||
|
|
||||||
|
- Everything from slug admin level, cross-slug view.
|
||||||
|
- Crashes per slug/device/user over time.
|
||||||
|
- Crash trend by app version / Android API / fingerprint.
|
||||||
|
- Crash-to-ticket linkage counts with issue tracker links.
|
||||||
|
- Top unreliable slugs/devices (rate-based).
|
||||||
|
|
||||||
|
## Estimates (engineering)
|
||||||
|
|
||||||
|
| Track | Initial delivery | Hardening | Total |
|
||||||
|
|---|---:|---:|---:|
|
||||||
|
| Grafana direct DB | 4-7 dev days | 5-8 dev days | 9-15 dev days |
|
||||||
|
| Custom PHP dashboards | 5-9 dev days | 3-6 dev days | 8-15 dev days |
|
||||||
|
| Hybrid phase-1 PHP then optional Grafana | 6-10 dev days | +4-7 dev days (optional) | 10-17 dev days |
|
||||||
|
|
||||||
|
_Assumptions: current MariaDB crash/ticket/session structures are available; no major schema rewrite._
|
||||||
|
|
||||||
|
## Recommendation under your constraints
|
||||||
|
|
||||||
|
1. Keep **single source of truth** in MariaDB (no ETL copy pipeline).
|
||||||
|
2. Build **SQL metrics views/contracts** first.
|
||||||
|
3. Implement **custom PHP dashboards** first for guaranteed auth and tenant correctness.
|
||||||
|
4. Add Grafana later only if direct DB + RBAC mapping is validated without complexity growth.
|
||||||
|
|
||||||
|
## Implementation slice (proposed)
|
||||||
|
|
||||||
|
1. Define metrics dictionary + SQL views by role scope (1-2 days).
|
||||||
|
2. Extend heartbeat with `time_source` + NTP correction savings fields (0.5-1 day).
|
||||||
|
3. Build user + slug-admin dashboard pages with 1d/7d selectors (3-5 days).
|
||||||
|
4. Build platform admin reliability board with crash/ticket links (2-3 days).
|
||||||
|
5. Optional Grafana POC on same views (2-3 days).
|
||||||
|
|
||||||
|
## Source linkage
|
||||||
|
|
||||||
|
- This markdown file is the editable source for:
|
||||||
|
- `tmp/GRAFANA_vs_others_graphvis_pivot.pdf`
|
||||||
93
docs/GRAFANA_vs_others_graphvis_pivot.pdf
Normal file
93
docs/GRAFANA_vs_others_graphvis_pivot.pdf
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
%PDF-1.4
|
||||||
|
%“Œ‹ž ReportLab Generated PDF document (opensource)
|
||||||
|
1 0 obj
|
||||||
|
<<
|
||||||
|
/F1 2 0 R /F2 3 0 R
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
2 0 obj
|
||||||
|
<<
|
||||||
|
/BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
3 0 obj
|
||||||
|
<<
|
||||||
|
/BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding /Name /F2 /Subtype /Type1 /Type /Font
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
4 0 obj
|
||||||
|
<<
|
||||||
|
/Contents 9 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 8 0 R /Resources <<
|
||||||
|
/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
|
||||||
|
>> /Rotate 0 /Trans <<
|
||||||
|
|
||||||
|
>>
|
||||||
|
/Type /Page
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
5 0 obj
|
||||||
|
<<
|
||||||
|
/Contents 10 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 8 0 R /Resources <<
|
||||||
|
/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
|
||||||
|
>> /Rotate 0 /Trans <<
|
||||||
|
|
||||||
|
>>
|
||||||
|
/Type /Page
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
6 0 obj
|
||||||
|
<<
|
||||||
|
/PageMode /UseNone /Pages 8 0 R /Type /Catalog
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
7 0 obj
|
||||||
|
<<
|
||||||
|
/Author (Android Cast project) /CreationDate (D:20260602143110+02'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20260602143110+02'00') /Producer (ReportLab PDF Library - \(opensource\))
|
||||||
|
/Subject (\(unspecified\)) /Title (Grafana vs Others GraphVis Pivot) /Trapped /False
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
8 0 obj
|
||||||
|
<<
|
||||||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1G,Sr'@Yag2pusAc9Ao6m2:T-\Gk0DKEh$N\P*j_Ihsp;d7P^FP8I06a+26#k!j@6&<X5aHY9c;WduiVampH8<5u%Q'l8pm-#?,eVaUSMuA7,X0Ht8$DL>tUToMN9i^,$9Q#C95cFq+-<rh[*]qZga5!nUY2(B~>endstream
|
||||||
|
endobj
|
||||||
|
xref
|
||||||
|
0 11
|
||||||
|
0000000000 65535 f
|
||||||
|
0000000061 00000 n
|
||||||
|
0000000102 00000 n
|
||||||
|
0000000209 00000 n
|
||||||
|
0000000321 00000 n
|
||||||
|
0000000524 00000 n
|
||||||
|
0000000728 00000 n
|
||||||
|
0000000796 00000 n
|
||||||
|
0000001102 00000 n
|
||||||
|
0000001167 00000 n
|
||||||
|
0000004095 00000 n
|
||||||
|
trailer
|
||||||
|
<<
|
||||||
|
/ID
|
||||||
|
[<8697b2018a3d689f70795c513a06ba7d><8697b2018a3d689f70795c513a06ba7d>]
|
||||||
|
% ReportLab generated PDF document -- digest (opensource)
|
||||||
|
|
||||||
|
/Info 7 0 R
|
||||||
|
/Root 6 0 R
|
||||||
|
/Size 11
|
||||||
|
>>
|
||||||
|
startxref
|
||||||
|
5356
|
||||||
|
%%EOF
|
||||||
204
docs/_pdf_build/build_graphvis_pivot_pdf.py
Normal file
204
docs/_pdf_build/build_graphvis_pivot_pdf.py
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Build tmp/GRAFANA_vs_others_graphvis_pivot.pdf decision memo."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from reportlab.lib import colors
|
||||||
|
from reportlab.lib.enums import TA_LEFT
|
||||||
|
from reportlab.lib.pagesizes import A4
|
||||||
|
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
|
||||||
|
from reportlab.lib.units import cm
|
||||||
|
from reportlab.platypus import Paragraph, SimpleDocTemplate, Spacer, Table, TableStyle
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
OUT_PDF = ROOT / "tmp" / "GRAFANA_vs_others_graphvis_pivot.pdf"
|
||||||
|
SOURCE_MD = ROOT / "tmp" / "GRAFANA_vs_others_graphvis_pivot.md"
|
||||||
|
|
||||||
|
|
||||||
|
def p(text: str, style) -> Paragraph:
|
||||||
|
return Paragraph(text.replace("\n", "<br/>"), style)
|
||||||
|
|
||||||
|
|
||||||
|
def add_table(story, headers: list[str], rows: list[list[str]], col_widths) -> None:
|
||||||
|
data = [headers] + rows
|
||||||
|
t = Table(data, colWidths=col_widths)
|
||||||
|
t.setStyle(
|
||||||
|
TableStyle(
|
||||||
|
[
|
||||||
|
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#1565C0")),
|
||||||
|
("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
|
||||||
|
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
|
||||||
|
("FONTSIZE", (0, 0), (-1, -1), 9),
|
||||||
|
("VALIGN", (0, 0), (-1, -1), "TOP"),
|
||||||
|
("GRID", (0, 0), (-1, -1), 0.5, colors.lightgrey),
|
||||||
|
("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#F5F5F5")]),
|
||||||
|
("LEFTPADDING", (0, 0), (-1, -1), 6),
|
||||||
|
("RIGHTPADDING", (0, 0), (-1, -1), 6),
|
||||||
|
("TOPPADDING", (0, 0), (-1, -1), 4),
|
||||||
|
("BOTTOMPADDING", (0, 0), (-1, -1), 4),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
story.append(t)
|
||||||
|
|
||||||
|
|
||||||
|
def build_pdf() -> None:
|
||||||
|
styles = getSampleStyleSheet()
|
||||||
|
title = ParagraphStyle(
|
||||||
|
"DocTitle",
|
||||||
|
parent=styles["Title"],
|
||||||
|
fontSize=18,
|
||||||
|
spaceAfter=10,
|
||||||
|
textColor=colors.HexColor("#1565C0"),
|
||||||
|
)
|
||||||
|
h1 = ParagraphStyle("H1", parent=styles["Heading1"], fontSize=14, spaceBefore=12, spaceAfter=6)
|
||||||
|
body = ParagraphStyle("Body", parent=styles["Normal"], fontSize=10, leading=14, alignment=TA_LEFT)
|
||||||
|
small = ParagraphStyle("Small", parent=body, fontSize=9, textColor=colors.grey)
|
||||||
|
bullet = ParagraphStyle("Bullet", parent=body, leftIndent=14, bulletIndent=6)
|
||||||
|
|
||||||
|
story: list = []
|
||||||
|
story.append(p("Android Cast — Graph Visualization Pivot", title))
|
||||||
|
story.append(p("Scope: LAMP + nginx backend, no data duplication pipeline, role-based analytics.", small))
|
||||||
|
story.append(Spacer(1, 0.25 * cm))
|
||||||
|
|
||||||
|
add_table(
|
||||||
|
story,
|
||||||
|
["Field", "Value"],
|
||||||
|
[
|
||||||
|
["Date", "2026-06-02"],
|
||||||
|
["Context", "apps.f0xx.org + BE Alpine (nginx + php-fpm + MariaDB)"],
|
||||||
|
["Constraint", "No cron ETL/data copy/pipeline complexity"],
|
||||||
|
["Output", "Decision memo: Grafana vs custom PHP dashboards"],
|
||||||
|
["Markdown source", str(SOURCE_MD.relative_to(ROOT))],
|
||||||
|
],
|
||||||
|
[4.2 * cm, 12.2 * cm],
|
||||||
|
)
|
||||||
|
|
||||||
|
story.append(Spacer(1, 0.35 * cm))
|
||||||
|
story.append(p("1. Executive summary", h1))
|
||||||
|
story.append(
|
||||||
|
p(
|
||||||
|
"• Grafana is viable only if it can query MariaDB directly (or via native SQL datasource) with strict RBAC mapping and SSO/session bridging.<br/>"
|
||||||
|
"• If direct DB + auth integration becomes complex, custom PHP dashboards are lower risk and fit your stack with zero infra additions.<br/>"
|
||||||
|
"• Recommended path: <b>hybrid</b> — build canonical SQL views + metrics contract once; start with custom PHP pages, optionally add Grafana later reusing same SQL.",
|
||||||
|
bullet,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
story.append(Spacer(1, 0.35 * cm))
|
||||||
|
story.append(p("2. Option comparison", h1))
|
||||||
|
add_table(
|
||||||
|
story,
|
||||||
|
["Option", "Pros", "Cons / Risks", "Stack impact"],
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"Grafana (direct DB)",
|
||||||
|
"Fast charting, polished visuals, alerting, flexible panels",
|
||||||
|
"Session/RBAC integration effort; slug scoping must be enforced in queries; additional service to operate",
|
||||||
|
"Adds Grafana service only (no ETL required)",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Custom PHP + nginx",
|
||||||
|
"Native app auth/session reuse; direct BE logic access; deterministic tenant filtering",
|
||||||
|
"More frontend/dev work for visual polish; chart UX must be implemented",
|
||||||
|
"No new runtime dependencies",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Hybrid (recommended)",
|
||||||
|
"Ship fast with PHP now, preserve Grafana option later; one metrics SQL contract",
|
||||||
|
"Needs discipline in shared metrics layer",
|
||||||
|
"Minimal immediate changes",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[3.1 * cm, 4.4 * cm, 5.0 * cm, 3.9 * cm],
|
||||||
|
)
|
||||||
|
|
||||||
|
story.append(Spacer(1, 0.35 * cm))
|
||||||
|
story.append(p("3. Role-based graph pack (suggested)", h1))
|
||||||
|
add_table(
|
||||||
|
story,
|
||||||
|
["Role", "Core dashboards", "Example charts"],
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"User",
|
||||||
|
"Own slug, own devices/sessions",
|
||||||
|
"DAU devices, avg cast duration, avg recv sessions/day, success rate, app version split",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Slug admin",
|
||||||
|
"All slug analytics + health",
|
||||||
|
"Active/passive users, bandwidth send/recv 1d/7d, install source pie (Play/OTA/custom), NTP source usage and correction savings",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Platform admin",
|
||||||
|
"Cross-slug global + reliability",
|
||||||
|
"Crashes per slug/device/user, trend by app version/SDK, links to ticket IDs/issues, top regressions by fingerprint",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[2.7 * cm, 5.1 * cm, 8.6 * cm],
|
||||||
|
)
|
||||||
|
|
||||||
|
story.append(Spacer(1, 0.35 * cm))
|
||||||
|
story.append(p("4. Effort and cost estimate (engineering)", h1))
|
||||||
|
add_table(
|
||||||
|
story,
|
||||||
|
["Track", "Initial delivery", "Hardening", "Total estimate"],
|
||||||
|
[
|
||||||
|
["Grafana direct DB", "4-7 dev days", "5-8 dev days", "9-15 dev days"],
|
||||||
|
["Custom PHP dashboards", "5-9 dev days", "3-6 dev days", "8-15 dev days"],
|
||||||
|
["Hybrid phase-1 PHP then Grafana", "6-10 dev days", "optional +4-7 days", "10-17 dev days"],
|
||||||
|
],
|
||||||
|
[4.3 * cm, 3.8 * cm, 3.8 * cm, 4.5 * cm],
|
||||||
|
)
|
||||||
|
story.append(
|
||||||
|
p(
|
||||||
|
"Assumptions: existing MariaDB schema with crash/ticket/session tables, role data available; excludes major schema migration.",
|
||||||
|
small,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
story.append(Spacer(1, 0.35 * cm))
|
||||||
|
story.append(p("5. Recommendation under your constraints", h1))
|
||||||
|
story.append(
|
||||||
|
p(
|
||||||
|
"• Do not introduce ETL/duplication. Keep one source of truth: MariaDB + live SQL views.<br/>"
|
||||||
|
"• Implement a metrics SQL layer now (views/materialized semantics via SQL only, no copied store).<br/>"
|
||||||
|
"• Build custom PHP dashboard pages first for guaranteed auth/session + slug scoping correctness.<br/>"
|
||||||
|
"• Re-evaluate Grafana after metrics contract stabilizes; adopt only if direct DB + RBAC mapping is clean.",
|
||||||
|
bullet,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
story.append(Spacer(1, 0.35 * cm))
|
||||||
|
story.append(p("6. Proposed next implementation slice", h1))
|
||||||
|
add_table(
|
||||||
|
story,
|
||||||
|
["Step", "Deliverable", "ETA"],
|
||||||
|
[
|
||||||
|
["1", "Define metrics dictionary + SQL views for user/slug/admin scopes", "1-2 days"],
|
||||||
|
["2", "Add heartbeat metric: time source in use + ntp correction savings counters", "0.5-1 day"],
|
||||||
|
["3", "Create PHP dashboards: user and slug-admin pages with 1d/7d selectors", "3-5 days"],
|
||||||
|
["4", "Add admin reliability board + crash/ticket links", "2-3 days"],
|
||||||
|
["5", "Optional Grafana POC over same SQL views", "2-3 days"],
|
||||||
|
],
|
||||||
|
[1.2 * cm, 11.9 * cm, 3.3 * cm],
|
||||||
|
)
|
||||||
|
|
||||||
|
doc = SimpleDocTemplate(
|
||||||
|
str(OUT_PDF),
|
||||||
|
pagesize=A4,
|
||||||
|
leftMargin=1.8 * cm,
|
||||||
|
rightMargin=1.8 * cm,
|
||||||
|
topMargin=1.6 * cm,
|
||||||
|
bottomMargin=1.6 * cm,
|
||||||
|
title="Grafana vs Others GraphVis Pivot",
|
||||||
|
author="Android Cast project",
|
||||||
|
)
|
||||||
|
doc.build(story)
|
||||||
|
print(f"Wrote {OUT_PDF}")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
build_pdf()
|
||||||
7
scripts/build-graphvis-pdf.sh
Normal file
7
scripts/build-graphvis-pdf.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
|
||||||
|
python3 "$ROOT_DIR/docs/_pdf_build/build_graphvis_pivot_pdf.py"
|
||||||
|
echo "Generated: $ROOT_DIR/tmp/GRAFANA_vs_others_graphvis_pivot.pdf"
|
||||||
1
third-party/opus
vendored
Submodule
1
third-party/opus
vendored
Submodule
Submodule third-party/opus added at 22244de5a7
1
third-party/speex
vendored
Submodule
1
third-party/speex
vendored
Submodule
Submodule third-party/speex added at 5dceaaf3e2
Reference in New Issue
Block a user