샘플 데이터 생성
이 가이드에서는 출시 패키지에 제공된 bash 스크립트를 사용하여 샘플 데이터를 생성하는 방법을 설명합니다.
시작하기 전에
기본 구성 패키지를 적용하거나 관련 메시지 클래스, 유형, 파서를 만들어야 합니다.
스크립트를 실행하여 샘플 데이터 생성
/testing/send-data-to-mde.sh 파일의 배포 패키지에서 bash 스크립트를 찾습니다. 이 스크립트에는 두 개의 인수가 필요합니다.
- 프로젝트 ID입니다.
- 전송할 데이터 유형입니다.
numeric또는discrete일 수 있습니다.
데이터를 전송할 때 타임스탬프가 자동으로 삽입되고 나머지 값은 동일합니다. 다른 페이로드를 전송하려면 bash 스크립트를 수정하세요.
예를 들어 numeric 데이터를 전송하려면 다음 명령어를 사용합니다.
./send-data-to-mde.sh PROJECT_ID numeric
다음과 비슷한 응답이 표시됩니다.
send-data-to-mde.sh: ***** Welcome to the MDE Data Generator *****
This script will send numeric data to MDE so that you can
validate that the entire pipeline is working
PROJECT_ID set to PROJECT_ID
You're authenticated as USER_EMAIL
Do you want to start sending data [Y/n]? Y
Sending messages every 5 seconds
Press [CTRL+C] to stop..
Sent:
{
"tagName": "mde-test-numeric",
"timestamp": "1695643807000",
"value": 10
}
messageIds:
- '8840355690320815'
discrete 데이터를 전송하려면 다음 명령어를 사용합니다.
./send-data-to-mde.sh PROJECT_ID discrete
다음과 비슷한 응답이 표시됩니다.
send-data-to-mde.sh: ***** Welcome to the MDE Data Generator *****
This script will send discrete data to MDE so that you can
validate that the entire pipeline is working
PROJECT_ID set to PROJECT_ID
You're authenticated as USER_EMAIL
Do you want to start sending data [Y/n]? Y
Sending messages every 5 seconds
Press [CTRL+C] to stop..
Sent:
{
"tagName": "mde-test-discrete",
"timestamp": "1695643827000",
"value": {
"test1": true,
"test2": "someValue"
}
}
messageIds:
- '9223124765272389'