尝试访问对Apache Kafka具有巡航控制功能的API。 要打个电话,它说
- 获取按给定资源利用率排序并按给定主题正则表达式和分区号/范围过滤的分区负载
GET / kafkacruisecontrol / partition_load?resource = [RESOURCE]&start = [START_TIMESTAMP]&end = [END_TIMESTAMP] &topic = [topic]&partition = [partition / start_partition-end_partition]
和
- 注意:所有时间戳均为以秒为单位的纪元时间(在文档中给出)
这是我构造的URL(根据我的要求,我只需要开始和结束时间)
当我遇到这个问题时,它会引发以下异常
<?php
include('config.php');
$fromDate = $_GET['from'];
$toDate = $_GET['to'];
$type = $_GET['type'];
$x = 1;
$total = 0;
$grandTotal = '';
$byData = mysqli_query($con,"CALL reportByDate('".$fromDate."','".$toDate."')") or die(mysqli_error($con));
if(mysqli_num_rows($byData)>0)
{
if($type=='all')
{
?>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>#</th>
<th class="numeric">Type</th>
<th class="numeric">Token</th>
<th class="numeric" style="width:15%">Patient Name</th>
<th class="numeric">Age</th>
<th class="numeric">Gender</th>
<th class="numeric" style="width:12%">Refferred By</th>
<th class="numeric" style="width:15%">Reff. By Address</th>
<th class="numeric" style="width:13%">Purpose of visit</th>
<th class="numeric">Amount</th>
<th class="numeric" style="width:12%">Date</th>
<th class="numeric">Time</th>
<th class="numeric">Status</th>
</tr>
</thead>
<?php
while($byDataResult = mysqli_fetch_assoc($byData))
{
$total = $total+$byDataResult['Amount'];
?>
<tr>
<td><?php echo $x; ?></td>
<td><?php echo $byDataResult['ScanType']; ?></td>
<td><?php echo $byDataResult['TokenYesterday']."/".$byDataResult['TokenToday'] ?></td>
<td class="numeric"><?php echo $byDataResult['PatientName']; ?></td>
<td class="numeric"><?php echo $byDataResult['Age']; ?></td>
<td class="numeric"><?php echo $byDataResult['Sex']; ?></td>
<td class="numeric"><?php echo $byDataResult['RefferredBy']; ?></td>
<td class="numeric"><?php echo $byDataResult['ReffByAddress']; ?></td>
<td class="numeric" style="width: 300px;"><?php echo substr($byDataResult['PurposeOfvisit'],0,100); ?></td>
<td class="numeric"><?php echo number_format($byDataResult['Amount'],2); ; ?></td>
<td class="numeric"><?php echo $byDataResult['Date']; ?></td>
<td class="numeric"><?php echo $byDataResult['created_at']; ?></td>
<td class="numeric" style="color: red;text-align: center;">
<?php
if( $byDataResult['Status']==2)
{
echo 'Edited';
}
else{
echo "---";
}
?></td>
</tr>
<?php
$x++;
}
?>
<tr class="totalRow">
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th style="text-align: right;">Total</th>
<th><?php echo number_format($total,2); ?>/-</th>
<th></th>
<th></th>
<th></th>
</tr>
</tbody>
</table>
<?php
}
else{
$x = 1;
$total = 0;
$grandTotal = '';
$byDataType = mysqli_query($con,"CALL reportByDateType('".$fromDate."','".$toDate."','".$type."')") or die(mysqli_error($con));
if(mysqli_num_rows($byDataType)>0){
?>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>#</th>
<th class="numeric">Type</th>
<th class="numeric">Token</th>
<th class="numeric" style="width:15%">Patient Name</th>
<th class="numeric">Age</th>
<th class="numeric">Gender</th>
<th class="numeric" style="width:12%">Refferred By</th>
<th class="numeric" style="width:15%">Reff. By Address</th>
<th class="numeric" style="width:13%">Purpose of visit</th>
<th class="numeric">Amount</th>
<th class="numeric" style="width:12%">Date</th>
<th class="numeric">Time</th>
<th class="numeric">Status</th>
</tr>
</thead>
<?php
while($byDataResults = mysqli_fetch_assoc($byDataType))
{
$total = $total+$byDataResults['Amount'];
?>
<tr>
<td><?php echo $x; ?></td>
<td><?php echo $byDataResults['ScanType']; ?></td>
<td><?php echo $byDataResults['TokenYesterday']."/".$byDataResults['TokenToday'] ?></td>
<td class="numeric"><?php echo $byDataResults['PatientName']; ?></td>
<td class="numeric"><?php echo $byDataResults['Age']; ?></td>
<td class="numeric"><?php echo $byDataResults['Sex']; ?></td>
<td class="numeric"><?php echo $byDataResults['RefferredBy']; ?></td>
<td class="numeric"><?php echo $byDataResults['ReffByAddress']; ?></td>
<td class="numeric"><?php echo substr($byDataResults['PurposeOfvisit'],0,100); ?></td>
<td class="numeric"><?php echo number_format($byDataResults['Amount'],2); ; ?></td>
<td class="numeric"><?php echo $byDataResults['Date']; ?></td>
<td class="numeric"><?php echo $byDataResults['created_at']; ?></td>
<td class="numeric" style="color: red;text-align: center;">
<?php
if( $byDataResults['Status']==2)
{
echo 'Edited';
}
else{
echo "---";
}
?></td>
</tr>
<?php
$x++;
}
?>
<tr class="totalRow">
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th style="text-align: right;">Total</th>
<th><?php echo number_format($total,2); ?>/-</th>
<th></th>
<th></th>
<th></th>
</tr>
</tbody>
</table>
<?php
}
else{
?>
<h3 style="text-align: center">Sorry! No Record Found</h3>
<?php
}
}
}
else{
?>
<h3 style="text-align: center">Sorry! No Record Found</h3>
<?php
}
?>
我想念东西吗?
供参考,这里是定速巡航API的git hub link