Skip to content

Instantly share code, notes, and snippets.

View SabaPing's full-sized avatar
🥰
~~~~~~~~

Yifan Xu SabaPing

🥰
~~~~~~~~
  • PingCAP
  • Hangzhou
View GitHub Profile
@SabaPing
SabaPing / iftop.sh
Created August 22, 2023 09:06 — forked from lemonlatte/iftop.sh
Amazon Linux install iftop
amazon-linux-extras install epel -y
yum-config-manager --enable epel
yum install iftop
@SabaPing
SabaPing / cats-effect-intro.md
Last active July 29, 2024 08:05
Cats-Effect简介

Cats-Effect

Introduction

image.png 这篇文档介绍了统一查询层的底层运行库 -- cats-effect.  统一查询层是个综合工程, 在这里我们选取其中的一个 -- apm module作为例子, 分析cats-effect的原理和具体用法. 

apm module是一个web service项目, 他连接了前端请求和后端数据存储. apm module提供的api基本遵循一个统一的模式:

前端请求q1 --> 将q1转化成即席查询请求q2 --> 从mysql补全q2的元信息 --> 发起即席查询(es/druid/prometheus), 获得结果q2 --> 将q2转化成前端需要的格式q1 --> 返回给前端

@SabaPing
SabaPing / gitcom.md
Created April 1, 2019 03:43 — forked from jednano/gitcom.md
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

$ git init
@SabaPing
SabaPing / polymorphism_in_scala.md
Last active October 5, 2018 10:12
Polymorphism in Scala

Polymorphism in Scala

Scala(或者functional programming)中实现polymorphism的正确模式.

TL;DR

1. 相信在Coding时, 花额外的精力保证type-safety, 最终能够提升工程质量

Type-safety is making use of what we know of our values at compile-time to minimize the consequences of most mistakes.

2. Functional programming(fp)中有两种封装data的基本形式, 分别是product和coproduct, 合在一起叫algebraic data types(ADTs)