kafka_neu-1778570057504.zip-extract/kafka-4.2.0-src/tests/bin/external_trogdor_command_example.py

Path
kafka_neu-1778570057504.zip-extract/kafka-4.2.0-src/tests/bin/external_trogdor_command_example.py
Status
scanned
Type
file
Name
external_trogdor_command_example.py
Extension
.py
Programming language
Python
Mime type
text/x-script.python
File type
Python script, ASCII text executable
Tag

      
    
Rootfs path

      
    
Size
1642 (1.6 KB)
MD5
42eb028530598057972e0c2eaf5e267a
SHA1
88e03d55fa4b6a2c241307cdfd703385e66de991
SHA256
7e5d770baeebe492cc95fc98d81d3dd2dafe8aea48d9afff0ac6c3297917792b
SHA512

      
    
SHA1_git
1254b8283e33e29ade0e051da2343b7cfab03f09
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
external_trogdor_command_example.py | 1.6 KB |

#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import json import sys import time # # This is an example of an external script which can be run through Trogdor's # ExternalCommandWorker. It sleeps for the given amount of time expressed by the delayMs field in the ExternalCommandSpec # if __name__ == '__main__': # Read the ExternalCommandWorker start message. line = sys.stdin.readline() start_message = json.loads(line) workload = start_message["workload"] print("Starting external_trogdor_command_example with task id %s, workload %s" % (start_message["id"], workload)) sys.stdout.flush() # pretend to start some workload print(json.dumps({"status": "running"})) sys.stdout.flush() time.sleep(0.001 * workload["delayMs"]) print(json.dumps({"status": "exiting after %s delayMs" % workload["delayMs"]})) sys.stdout.flush()
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
51.29
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9
Package URL License Primary language
pkg:pypi/kafkatest@4.2.0 apache-2.0 Python