Skip to content

Instantly share code, notes, and snippets.

View thangarajan8's full-sized avatar
💭
Learning to How to Learn

itsthanga thangarajan8

💭
Learning to How to Learn
View GitHub Profile
@thangarajan8
thangarajan8 / latency.txt
Created January 23, 2020 12:44 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@thangarajan8
thangarajan8 / mongodb_2_pandas.py
Created July 3, 2017 08:20 — forked from jmquintana79/mongodb_2_pandas.py
Functions to connect and read mongodb data to pandas df
import pandas as pd
from pymongo import MongoClient
# set connection with mongodb
def _connect_mongo(host, port, username, password, db):
""" A util for making a connection to mongo """
if username and password:
mongo_uri = 'mongodb://%s:%s@%s:%s/%s' % (username, password, host, port, db)
conn = MongoClient(mongo_uri)
@thangarajan8
thangarajan8 / import_csv_to_mongo
Created July 3, 2017 08:08 — forked from mprajwala/import_csv_to_mongo
Store CSV data into mongodb using python pandas
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)

Windows System Metrics

Processes

  • system.proc.queue_length: The process queue length.
  • system.proc.count: The count of running processes.

Memory

@thangarajan8
thangarajan8 / clk.tsv
Created May 24, 2016 10:49 — forked from ceteri/clk.tsv
Intro to Apache Spark: code example for (K,V), join, operator graph
2014-03-04 15dfb8e6cc4111e3a5bb600308919594 11
2014-03-06 81da510acc4111e387f3600308919594 61