-
Notifications
You must be signed in to change notification settings - Fork 525
113 lines (93 loc) · 3.41 KB
/
perf-long-running-end-to-end.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Linux Memory Test
on:
workflow_dispatch:
jobs:
test-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
override: true
cache: true
rustflags: ""
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y tesseract-ocr libtesseract-dev libavformat-dev libavfilter-dev libavdevice-dev ffmpeg libasound2-dev libgtk-3-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev xvfb pulseaudio gnuplot
- name: Set up virtual display
run: |
Xvfb :99 -ac &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Set up virtual audio
run: |
pulseaudio --start
pacmd load-module module-null-sink sink_name=virtual_speaker
pacmd load-module module-virtual-source source_name=virtual_mic
pacmd set-default-sink virtual_speaker
pacmd set-default-source virtual_mic
- name: Build screenpipe
run: cargo build --release
- name: Run screenpipe and monitor memory
run: |
export DISPLAY=:99
export PULSE_SERVER=unix:/tmp/pulse-socket
./target/release/screenpipe --debug &
SCREENPIPE_PID=$!
echo "Timestamp,RSS (KB),VSZ (KB)" > memory_usage.csv
for i in {1..90}; do
RSS=$(ps -o rss= -p $SCREENPIPE_PID)
VSZ=$(ps -o vsz= -p $SCREENPIPE_PID)
echo "$(date +%s),$RSS,$VSZ" >> memory_usage.csv
sleep 10
done
kill $SCREENPIPE_PID
- name: Generate memory usage graph
run: |
gnuplot <<EOF
set terminal png size 800,600
set output 'memory_usage_graph.png'
set title 'Screenpipe Memory Usage Over Time'
set xlabel 'Time (seconds)'
set ylabel 'Memory Usage (KB)'
set key outside
plot 'memory_usage.csv' using 1:2 with lines title 'RSS', \
'' using 1:3 with lines title 'VSZ'
EOF
- name: Upload memory usage data
uses: actions/upload-artifact@v4
with:
name: memory-usage-data
path: memory_usage.csv
- name: Upload memory usage graph
uses: actions/upload-artifact@v4
with:
name: memory-usage-graph
path: memory_usage_graph.png
- name: Check logs and data
run: |
echo "Checking logs..."
tail -n 100 ~/.screenpipe/logs/screenpipe.$(date +%Y-%m-%d).log
echo "Checking database..."
sqlite3 ~/.screenpipe/db.sqlite ".tables"
sqlite3 ~/.screenpipe/db.sqlite "SELECT COUNT(*) FROM ocr_text;"
sqlite3 ~/.screenpipe/db.sqlite "SELECT COUNT(*) FROM audio_transcriptions;"
- name: Upload screenpipe data
uses: actions/upload-artifact@v4
with:
name: screenpipe-data
path: |
~/.screenpipe/logs
~/.screenpipe/db.sqlite