etc.
[shell] 트래픽 유발자
닉의네임
2022. 11. 18. 13:47
반응형
특정쿼리를 반복실행하여 elastic search node 들의 리소스 상태를 확인한다.
#!/bin/bash
cnt=0
while (("${cnt}" < 5)); do
echo "${cnt}"
nohup sh doo.sh 2>&1 >braze_"${cnt}"_$(date +%Y)-$(date +%m)-$(date +%d)_$(date +%H):$(date +%M):$(date +%S).txt &
((cnt = "${cnt}" + 1))
done
echo "END"
#!/bin/bash
cnt=0
while (("${cnt}" < 500)); do
echo "${cnt} data now : $(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)"
curl -X GET "localhost:9200/hyper-item/_search?pretty" -u elastic:암오 -H 'Content-Type: application/json' -d'
{
"from": 0,
"size": 20,
"timeout": "60s",
"query": {
"bool": {
"filter": [
{
"range": {
"saleStartDt": {
"from": null,
"to": "now/m",
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
{
"range": {
"saleEndDt": {
"from": "now/m",
"to": null,
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
{
"term": {
"docDispYn": {
"value": "Y",
"boost": 1
}
}
},
{
"bool": {
"should": [
{
"terms": {
"itemStoreInfo.storeId": [
"37",
"20163"
],
"boost": 1
}
},
{
"term": {
"shipMethod": {
"value": "TD_DLV",
"boost": 1
}
}
},
{
"term": {
"storeType": {
"value": "DS",
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
{
"term": {
"category.lcateCd": {
"value": 100008,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"sort": [
{
"adultSort": {
"order": "asc"
}
},
{
"itemStoreInfo.weight": {
"order": "desc"
}
},
{
"itemStoreInfo.buyerCnt": {
"order": "desc"
}
},
{
"itemNo": {
"order": "desc"
}
}
]
}
'
((cnt = "${cnt}" + 1))
done
반응형