❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

πŸ“Š Learn PostgreSQL in Tamil: From Zero to 5β˜… on HackerRank in Just 10 Days

25 May 2025 at 12:42

Β 

PostgreSQL is one of the most powerful, stable, and open-source relational database systems trusted by global giants like Apple, Instagram, and Spotify. Whether you’re building a web application, managing enterprise data, or diving into analytics, understanding PostgreSQL is a skill that sets you apart.

But what if you could master it in just 10 days, in Tamil, with hands-on learning and a guaranteed 5β˜… rating on HackerRank as your goal?

Sounds exciting? Let’s dive in.

🎯 Why This Bootcamp?

This 10-day PostgreSQL Bootcamp in Tamil is designed to take you from absolute beginner to confident practitioner, with a curriculum built around real-world use cases, performance optimization, and daily challenge-driven learning.

Whether you’re a

  • Student trying to get into backend development
  • Developer wanting to upskill and crack interviews
  • Data analyst exploring SQL performance
  • Tech enthusiast curious about databases

…this bootcamp gives you the structured path you need.

🧠 What You’ll Learn

Over 10 days, we’ll cover

  • βœ… PostgreSQL installation & setup
  • βœ… PostgreSQL architecture and internals
  • βœ… Writing efficient SQL queries with proper formatting
  • βœ… Joins, CTEs, subqueries, and advanced querying
  • βœ… Indexing, query plans, and performance tuning
  • βœ… Transactions, isolation levels, and locking mechanisms
  • βœ… Schema design for real-world applications
  • βœ… Debugging techniques, tips, and best practices
  • βœ… Daily HackerRank challenges to track your progress
  • βœ… Solve 40+ HackerRank SQL challenges

πŸ§ͺ Bootcamp Highlights

  • πŸ—£ Language of instruction: Tamil
  • πŸ’» Format: Online, live and interactive
  • πŸŽ₯ Daily live sessions with Q&A
  • πŸ“Š Practice-oriented learning using HackerRank
  • πŸ“š Notes, cheat sheets, and shared resources
  • πŸ§‘β€πŸ€β€πŸ§‘ Access to community support and mentorship
  • 🧠 Learn through real-world datasets and scenarios

Check our previous Postgres session

πŸ“… Details at a Glance

  • Duration: 10 Days
  • Language: Tamil
  • Format: Online, hands-on
  • Book Your Slot: https://topmate.io/parottasalna/1558376
  • Goal: Earn 5β˜… in PostgreSQL on HackerRank
  • Suitable for: Students, developers, DBAs, and tech enthusiasts

πŸ”₯ Why You Shouldn’t Miss This

  • Learn one of the most in-demand database systems in your native language
  • Structured learning path with practical tasks and daily targets
  • Build confidence to work on real projects and solve SQL challenges
  • Lifetime value from one affordable investment.

Will meet you in session !!!

Locust EP 2: Understanding Locust Wait Times with Complete Examples

17 November 2024 at 07:43

Locust is an excellent load testing tool, enabling developers to simulate concurrent user traffic on their applications. One of its powerful features is wait times, which simulate the realistic user think time between consecutive tasks. By customizing wait times, you can emulate user behavior more effectively, making your tests reflect actual usage patterns.

In this blog, we’ll cover,

  1. What wait times are in Locust.
  2. Built-in wait time options.
  3. Creating custom wait times.
  4. A full example with instructions to run the test.

What Are Wait Times in Locust?

In real-world scenarios, users don’t interact with applications continuously. After performing an action (e.g., submitting a form), they often pause before the next action. This pause is called a wait time in Locust, and it plays a crucial role in mimicking real-life user behavior.

Locust provides several ways to define these wait times within your test scenarios.

FastAPI App Overview

Here’s the FastAPI app that we’ll test,


from fastapi import FastAPI

# Create a FastAPI app instance
app = FastAPI()

# Define a route with a GET method
@app.get("/")
def read_root():
    return {"message": "Welcome to FastAPI!"}

@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
    return {"item_id": item_id, "q": q}

Locust Examples for FastAPI

1. Constant Wait Time Example

Here, we’ll simulate constant pauses between user requests


from locust import HttpUser, task, constant

class FastAPIUser(HttpUser):
    wait_time = constant(2)  # Wait for 2 seconds between requests

    @task
    def get_root(self):
        self.client.get("/")  # Simulates a GET request to the root endpoint

    @task
    def get_item(self):
        self.client.get("/items/42?q=test")  # Simulates a GET request with path and query parameters

2. Between wait time Example

Simulating random pauses between requests.


from locust import HttpUser, task, between

class FastAPIUser(HttpUser):
    wait_time = between(1, 5)  # Random wait time between 1 and 5 seconds

    @task(3)  # Weighted task: this runs 3 times more often
    def get_root(self):
        self.client.get("/")

    @task(1)
    def get_item(self):
        self.client.get("/items/10?q=locust")

3. Custom Wait Time Example

Using a custom wait time function to introduce more complex user behavior


import random
from locust import HttpUser, task

def custom_wait():
    return max(1, random.normalvariate(3, 1))  # Normal distribution (mean: 3s, stddev: 1s)

class FastAPIUser(HttpUser):
    wait_time = custom_wait

    @task
    def get_root(self):
        self.client.get("/")

    @task
    def get_item(self):
        self.client.get("/items/99?q=custom")


Full Test Example

Combining all the above elements, here’s a complete Locust test for your FastAPI app.


from locust import HttpUser, task, between
import random

# Custom wait time function
def custom_wait():
    return max(1, random.uniform(1, 3))  # Random wait time between 1 and 3 seconds

class FastAPIUser(HttpUser):
    wait_time = custom_wait  # Use the custom wait time

    @task(3)
    def browse_homepage(self):
        """Simulates browsing the root endpoint."""
        self.client.get("/")

    @task(1)
    def browse_item(self):
        """Simulates fetching an item with ID and query parameter."""
        item_id = random.randint(1, 100)
        self.client.get(f"/items/{item_id}?q=test")

Running Locust for FastAPI

  1. Run Your FastAPI App
    Save the FastAPI app code in a file (e.g., main.py) and start the server

uvicorn main:app --reload

By default, the app will run on http://127.0.0.1:8000.

2. Run Locust
Save the Locust file as locustfile.py and start Locust.


locust -f locustfile.py

3. Configure Locust
Open http://localhost:8089 in your browser and enter:

  • Host: http://127.0.0.1:8000
  • Number of users and spawn rate based on your testing requirements.

4. Run in Headless Mode (Optional)
Use the following command to run Locust in headless mode


locust -f locustfile.py --headless -u 50 -r 10 --host http://127.0.0.1:8000`

-u 50: Simulate 50 users.

-r 10: Spawn 10 users per second.

❌
❌