Skip to content

2025

Task Sesi 5: Shell Scripting

Project Challange

Deskripsi:

Anda adalah seorang DevOps Engineer di sebuah perusahaan yang memiliki banyak file log di direktori /var/logs. Anda diminta untuk membuat bash script untuk:

  • Membuat direktori baru dengan nama backup_ddmmyyyy berdasarkan tanggal saat ini.
  • Memindahkan semua file .log dari /var/logs ke direktori backup.
  • Membuat arsip zip dari direktori backup.
  • Menampilkan pesan sukses setelah proses selesai.

Tugas Peserta:

Buat Bash Script berdasarkan langkah di atas. Pastikan script:

  • Dapat dijalankan berulang kali tanpa menyebabkan konflik nama direktori.
  • Menangani error, misalnya jika direktori atau file tidak ditemukan.

Monitoring FastAPI Applications with RED Metrics

TLDR;

RED Metrics is a set of metrics used to monitor the performance of applications/services, focusing on user experience. Not for measuring resource usage like CPU, memory, or disk utilization.

Introduction

I often build PoC (Proof of Concept) AI application using FastAPI and not yet think too much about the performance of the application. You know at that stage we just hope it works. Until finally we release it to some users, all sorts of problems pop up and we struggle to figure out what is going wrong? Is it because of resource bottleneck? How many times the endpoint is hit until it reaches the bottleneck? Or is there something wrong with our code? This makes it difficult to control because we don't know what is the problem.

One way to control the performance of the application is to measure the performance of the application. As my teacher said, "If we can't measure it, we can't manage it"

There are many ways to measure the performance of our application, one of them is by using RED Metrics.