Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ services:
- backend

prometheus:
container_name: prometheus
image: prom/prometheus:latest
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.enable-remote-write-receiver'
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
Expand All @@ -100,6 +104,7 @@ services:
- backend

grafana:
container_name: grafana
image: grafana/grafana:latest
environment:
GF_SECURITY_ADMIN_USER: admin
Expand All @@ -113,6 +118,12 @@ services:
volumes:
- grafana-data:/var/lib/grafana

pushgateway:
container_name: pushgateway
image: prom/pushgateway:latest
ports:
- "9091:9091"

volumes:
pgdata:
kafka-data:
Expand Down
2 changes: 1 addition & 1 deletion microservice-moderation
Submodule microservice-moderation updated 45 files
+3 −0 data/test/error_analysis_dataset.csv
+3 −0 data/test/llm/error_analysis_batch/error_analysis_dataset_batch_1.csv
+3 −0 data/test/llm/error_analysis_batch/error_analysis_dataset_batch_2.csv
+3 −0 data/test/llm/error_analysis_batch/error_analysis_dataset_batch_3.csv
+3 −0 data/test/llm/error_analysis_batch/error_analysis_dataset_batch_4.csv
+3 −0 data/test/llm/error_analysis_batch/error_analysis_dataset_batch_5.csv
+69 −7 docs/docs.md
+22 −8 docs/research_paper.md
+49 −1 docs/training_log.md
+1 −1 notebooks/01_baseline_experiments.ipynb
+1 −2 notebooks/02_distilbert_experiments.ipynb
+1,508 −5 notebooks/05_error_analysis.ipynb
+9 −0 results/errors/classical/phase1_classical_error_summary.json
+3 −0 results/errors/classical/phase1_classical_false_negatives.csv
+3 −0 results/errors/classical/phase1_classical_false_positives.csv
+3 −0 results/errors/classical/phase1_classical_prediction_log.csv
+38 −0 results/errors/llm/qwen3-4b-thinking/qwen_combined_summary.json
+3 −0 results/errors/llm/qwen3-4b-thinking/qwen_results_batch_1.csv
+3 −0 results/errors/llm/qwen3-4b-thinking/qwen_results_batch_2.csv
+3 −0 results/errors/llm/qwen3-4b-thinking/qwen_results_batch_3.csv
+3 −0 results/errors/llm/qwen3-4b-thinking/qwen_results_batch_4.csv
+3 −0 results/errors/llm/qwen3-4b-thinking/qwen_results_batch_5.csv
+38 −0 results/errors/llm/qwen3-4b-thinking/qwen_summary_batch_1.json
+28 −0 results/errors/llm/qwen3-4b-thinking/qwen_summary_batch_2.json
+28 −0 results/errors/llm/qwen3-4b-thinking/qwen_summary_batch_3.json
+38 −0 results/errors/llm/qwen3-4b-thinking/qwen_summary_batch_4.json
+38 −0 results/errors/llm/qwen3-4b-thinking/qwen_summary_batch_5.json
+15 −0 results/errors/transformer/distilBert/phase2_distilbert_error_summary.json
+3 −0 results/errors/transformer/distilBert/phase2_distilbert_false_negatives.csv
+3 −0 results/errors/transformer/distilBert/phase2_distilbert_false_positives.csv
+3 −0 results/errors/transformer/distilBert/phase2_distilbert_prediction_log.csv
+15 −0 results/errors/transformer/toxicBert/phase2.5_toxicBERT_error_summary.json
+3 −0 results/errors/transformer/toxicBert/phase2.5_toxicBERT_false_negatives.csv
+3 −0 results/errors/transformer/toxicBert/phase2.5_toxicBERT_false_positives.csv
+3 −0 results/errors/transformer/toxicBert/phase2.5_toxicBERT_prediction_log.csv
+ results/visuals/accuracy_comparison_all_models_error_analysis.png
+ results/visuals/confusion_matrix_phase1_error_analysis.png
+ results/visuals/confusion_matrix_phase2_distilBert_error_analysis.png
+ results/visuals/confusion_matrix_phase2_toxicBert_error_analysis.png
+ results/visuals/confusion_matrix_phase3_qwen3_error_analysis.png
+ results/visuals/f1_comparison_all_models_error_analysis.png
+ results/visuals/per_class_f1_phase1_error_analysis.png
+ results/visuals/per_class_f1_phase2_distilBERT_error_analysis.png
+ results/visuals/per_class_f1_phase2_toxicBERT_error_analysis.png
+ results/visuals/per_class_f1_phase3_qwen3_error_analysis.png
9 changes: 8 additions & 1 deletion monitoring/prometheus.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
global:
scrape_interval: 5s

remote_write:
- url: http://prometheus:9090/api/v1/write

scrape_configs:
- job_name: 'springboot-app'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['backend:8080']
- targets: ['backend:8080']

- job_name: 'k6'
static_configs:
- targets: ['pushgateway:9091']
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ export default function () {
check(res, { 'DELETE load': (r) => [200, 204, 404].includes(r.status) });
sleep(Math.random() * 5 + 2)
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_load_delete_course_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ export default function () {
const res = http.del(`${BASE_URL}/${courseId}`, null, { headers: defaultHeaders });
check(res, { 'DELETE spike': (r) => [200, 204, 404].includes(r.status) });
sleep(Math.random() * 5 + 2)
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_spike_delete_course_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ export default function () {
const res = http.del(`${BASE_URL}/${courseId}`, null, { headers: defaultHeaders });
check(res, { 'DELETE stress': (r) => [200, 204, 404].includes(r.status) });
sleep(Math.random() * 5 + 2);
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_stress_delete_course_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ export default function () {
check(res, { 'GET /api/courses status 200': (r) => checkResponse(r, 200, 'GET /api/courses') });
sleep(Math.random() * 2 + 1);
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_load_get_all_courses_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ export default function () {
const res = http.get(BASE_URL, { headers: defaultHeaders });
check(res, { 'GET /api/courses status 200': (r) => checkResponse(r, 200, 'GET /api/courses') });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_spike_get_all_courses_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ export default function () {
const res = http.get(BASE_URL, { headers: defaultHeaders });
check(res, { 'GET /api/courses status 200': (r) => checkResponse(r, 200, 'GET /api/courses') });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_stress_get_all_courses_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ const COURSE_ID = __ENV.COURSE_ID || '1';
export default function () {
const res = http.get(`${BASE_URL}/${COURSE_ID}`, { headers: defaultHeaders });
check(res, { 'GET /api/courses/{id} status 200': (r) => checkResponse(r, 200, 'GET /api/courses/{id}') });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_load_get_courses_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ const COURSE_ID = __ENV.COURSE_ID || '1';
export default function () {
const res = http.get(`${BASE_URL}/${COURSE_ID}`, { headers: defaultHeaders });
check(res, { 'GET /api/courses/{id} status 200': (r) => checkResponse(r, 200, 'GET /api/courses/{id}') });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_spike_get_courses_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ const COURSE_ID = __ENV.COURSE_ID || '1';
export default function () {
const res = http.get(`${BASE_URL}/${COURSE_ID}`, { headers: defaultHeaders });
check(res, { 'GET /api/courses/{id} status 200': (r) => checkResponse(r, 200, 'GET /api/courses/{id}') });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_stress_get_courses_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ export default function () {
check(res, { 'GET /api/courses/name/{name} returns 200': (r) => checkResponse(r, 200) });
sleep(0.5);
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_load_get_courses_by_name_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ export default function () {

const res = http.get(`${BASE_URL}/name/${courseName}`, { headers: defaultHeaders });
check(res, { 'GET /api/courses/name/{name} returns 200': (r) => checkResponse(r, 200) });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_spike_get_courses_by_name_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ export default function () {

const res = http.get(`${BASE_URL}/name/${courseName}`, { headers: defaultHeaders });
check(res, { 'GET /api/courses/name/{name} returns 200': (r) => checkResponse(r, 200) });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_stress_get_courses_by_name_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ export default function () {
const res = http.get(`${BASE_URL}/1/lessons`, { headers: defaultHeaders });
check(res, { 'GET /api/courses/1/lessons returns 200': (r) => checkResponse(r, 200) });
sleep(0.5);
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_load_get_course_lessons_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ export let options = {
export default function () {
const res = http.get(`${BASE_URL}/1/lessons`, { headers: defaultHeaders });
check(res, { 'GET /api/courses/1/lessons returns 200': (r) => checkResponse(r, 200) });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_spike_get_course_lessons_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@ export default function () {

const res = http.get(`${BASE_URL}/1/lessons`, { headers: defaultHeaders });
check(res, { 'GET /api/courses/1/lessons returns 200': (r) => checkResponse(r, 200) });
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_stress_get_course_lessons_by_id_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ export default function () {
const res = http.post(BASE_URL, { headers: defaultHeaders });
check(res, { 'POST /api/courses status 200': (r) => checkResponse(r, 200, 'POST /api/courses') });
sleep(Math.random() * 2 + 1);
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_load_post_all_courses_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ export default function () {
'POST /api/courses → status 201': (r) =>
checkResponse(r, 201, 'POST /api/courses'),
});
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_spike_post_all_courses_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,11 @@ export default function () {
checkResponse(r, [200, 201], 'POST /api/courses'),
});
sleep(Math.random() * 5 + 2);
}

export function handleSummary(data) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return {
[`./tests/performance/results/summary_stress_post_all_courses_${timestamp}.json`]: JSON.stringify(data, null, 2),
};
}
Loading