---
# System prepended metadata

title: K6 教學
tags: [操盤]

---

###### tags: `操盤`

# K6 教學

### 安裝

```
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6
```

或著

```
brew install k6
```

### 範例

```
import http from 'k6/http';
import { sleep } from 'k6';



export default function () {
  http.get(conbinationPath(route.Ping));
  sleep(1);
}
```

### 執行
```
k6 run test.js
```