İş Takibi
İş İlerleyişini İzleyin
İş yürütme durumunu takip edin, ilerlemeyi izleyin ve ayrıntılı yürütme günlüklerini alın.
İş Yürütme Günlüklerini Al
GET /api/{tenantId}/{projectId}/execution/job/{jobId}/logs
Belirli bir iş için ilerleme güncellemeleri, hata mesajları ve performans metrikleri dahil olmak üzere ayrıntılı yürütme günlüklerini getirir.
Parametreler
| Parametre | Tür | Konum | Açıklama |
|---|---|---|---|
tenantId |
GUID | Yol | Kiracı kimliği |
projectId |
GUID | Yol | Proje kimliği |
jobId |
GUID | Yol | İş kimliği |
Sorgu Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
level |
string | Günlük seviyesi filtrelemesi: DEBUG, INFO, WARN, ERROR (varsayılan: INFO) |
fromTime |
datetime | Bu zaman damgasından itibaren günlükleri al |
toTime |
datetime | Bu zaman damgasına kadar günlükleri al |
limit |
integer | Maksimum günlük kaydı sayısı (varsayılan: 1000, maksimum: 10000) |
format |
string | Yanıt formatı: structured, raw (varsayılan: structured) |
Yanıt
{
"jobId": "cc0e8400-e29b-41d4-a716-446655440000",
"jobName": "Müşteri Yolculuğu Analizi",
"jobStatus": "Çalışıyor",
"logsSummary": {
"totalEntries": 247,
"debugEntries": 89,
"infoEntries": 145,
"warnEntries": 11,
"errorEntries": 2,
"timeRange": {
"startTime": "2024-01-20T10:30:00Z",
"endTime": "2024-01-20T10:45:00Z"
}
},
"logs": [
{
"timestamp": "2024-01-20T10:30:15Z",
"level": "INFO",
"component": "DataLoader",
"stage": "Başlatma",
"message": "880e8400-e29b-41d4-a716-446655440000 veri kümesi için veri yükleme başlatılıyor",
"details": {
"datasetSize": "45.7 MB",
"expectedRecords": 192850,
"format": "CSV"
}
},
{
"timestamp": "2024-01-20T10:32:45Z",
"level": "INFO",
"component": "ProcessMiner",
"stage": "Veri İşleme",
"message": "15 partiden 1. partiyi işliyor",
"details": {
"batchSize": 12856,
"progress": 6.7,
"recordsPerSecond": 1247
}
},
{
"timestamp": "2024-01-20T10:38:22Z",
"level": "WARN",
"component": "DataValidator",
"stage": "Veri İşleme",
"message": "Eksik zaman damgasına sahip 125 kayıt bulundu",
"details": {
"affectedRecords": 125,
"action": "Zaman damgası çevre olaylardan türetildi",
"impactOnAnalysis": "Minimal"
}
},
{
"timestamp": "2024-01-20T10:41:10Z",
"level": "ERROR",
"component": "AnalyticsEngine",
"stage": "Analiz",
"message": "Dar boğaz analizinde bellek sınırı aşıldı",
"details": {
"memoryUsage": "3.8 GB",
"memoryLimit": "4.0 GB",
"action": "Disk tabanlı işleme geçiliyor",
"retry": true
}
},
{
"timestamp": "2024-01-20T10:45:33Z",
"level": "INFO",
"component": "ReportGenerator",
"stage": "Çıktı Oluşturma",
"message": "İşlem haritası görselleştirmesi oluşturuluyor",
"details": {
"activitiesCount": 47,
"pathsCount": 156,
"formatRequested": "SVG"
}
}
],
"executionMetrics": {
"currentStage": "Çıktı Oluşturma",
"stageProgress": 78,
"overallProgress": 85,
"processingRate": "1250 kayıt/saniye",
"memoryUsage": "2.3 GB",
"cpuUsage": 67,
"estimatedCompletion": "2024-01-20T10:52:00Z"
}
}
İş İlerleyişini Takip Et
GET /api/{tenantId}/{projectId}/execution/job/{jobId}/progress
Çalışan bir iş için aşama aşama tamamlama ve performans metrikleri dahil olmak üzere gerçek zamanlı ilerleme bilgisi alır.
Yanıt
{
"jobId": "cc0e8400-e29b-41d4-a716-446655440000",
"jobName": "Müşteri Yolculuğu Analizi",
"status": "Çalışıyor",
"overallProgress": {
"percentage": 85,
"startTime": "2024-01-20T10:30:00Z",
"elapsedTime": "15 dakika 33 saniye",
"estimatedRemaining": "2 dakika 27 saniye",
"estimatedCompletion": "2024-01-20T10:52:00Z"
},
"stages": [
{
"stageName": "Veri Yükleme",
"stageOrder": 1,
"status": "Tamamlandı",
"progress": 100,
"startTime": "2024-01-20T10:30:00Z",
"endTime": "2024-01-20T10:32:15Z",
"duration": "2 dakika 15 saniye",
"recordsProcessed": 192850,
"metrics": {
"throughput": "1427 kayıt/saniye",
"dataValidated": true,
"errorsFound": 0
}
},
{
"stageName": "Süreç Keşfi",
"stageOrder": 2,
"status": "Tamamlandı",
"progress": 100,
"startTime": "2024-01-20T10:32:15Z",
"endTime": "2024-01-20T10:41:30Z",
"duration": "9 dakika 15 saniye",
"recordsProcessed": 192850,
"metrics": {
"activitiesDiscovered": 47,
"variantsFound": 234,
"pathsIdentified": 156
}
},
{
"stageName": "Performans Analizi",
"stageOrder": 3,
"status": "Çalışıyor",
"progress": 78,
"startTime": "2024-01-20T10:41:30Z",
"estimatedEndTime": "2024-01-20T10:48:00Z",
"recordsProcessed": 150243,
"totalRecords": 192850,
"metrics": {
"bottlenecksIdentified": 8,
"waitTimeCalculated": 150243,
"cycleTimeCalculated": 150243
}
},
{
"stageName": "Rapor Oluşturma",
"stageOrder": 4,
"status": "Beklemede",
"progress": 0,
"estimatedStartTime": "2024-01-20T10:48:00Z",
"estimatedEndTime": "2024-01-20T10:52:00Z"
}
],
"currentActivity": {
"component": "PerformanceAnalyzer",
"operation": "Kaynak kullanımı metrikleri hesaplanıyor",
"details": "Verimlilik analizi için faaliyet geçişleri işleniyor"
},
"resourceUsage": {
"memoryUsage": "2.3 GB",
"memoryLimit": "4.0 GB",
"cpuUsage": 67,
"diskUsage": "890 MB",
"networkIO": "12 MB",
"processingRate": "1250 kayıt/saniye"
},
"qualityMetrics": {
"dataQualityScore": 94.8,
"validationsPassed": 15,
"validationsFailed": 1,
"warningsGenerated": 11,
"errorsEncountered": 2
}
}
İş Yürütme Zaman Çizelgesini Al
GET /api/{tenantId}/{projectId}/execution/job/{jobId}/timeline
Aşama geçişleri, kaynak tahsis değişiklikleri ve önemli kilometre taşları dahil olmak üzere iş yürütme olaylarının ayrıntılı zaman çizelgesini sağlar.
Sorgu Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
includeSubEvents |
boolean | Ayrıntılı alt olayları dahil et (varsayılan: false) |
granularity |
string | Zaman çizelgesi detay seviyesi: saniyeler, dakikalar, major_events (varsayılan: dakikalar) |
Yanıt
{
"jobId": "cc0e8400-e29b-41d4-a716-446655440000",
"jobName": "Müşteri Yolculuğu Analizi",
"timelineScope": {
"startTime": "2024-01-20T10:30:00Z",
"currentTime": "2024-01-20T10:45:33Z",
"endTime": null,
"granularity": "dakikalar"
},
"timeline": [
{
"timestamp": "2024-01-20T10:30:00Z",
"eventType": "İşBaşladı",
"description": "İş yürütme başlatıldı",
"details": {
"submittedBy": "user123",
"priority": "Yüksek",
"estimatedDuration": "20-25 dakika",
"resourcesAllocated": {
"cpuUnits": 2,
"memoryGB": 4,
"workerNode": "worker-node-02"
}
}
},
{
"timestamp": "2024-01-20T10:30:15Z",
"eventType": "AşamaBaşladı",
"description": "Veri Yükleme aşaması başlatıldı",
"details": {
"stageName": "Veri Yükleme",
"expectedDuration": "2-3 dakika",
"datasetSize": "45.7 MB",
"recordCount": 192850
}
},
{
"timestamp": "2024-01-20T10:32:15Z",
"eventType": "AşamaTamamlandı",
"description": "Veri Yükleme aşaması başarıyla tamamlandı",
"details": {
"stageName": "Veri Yükleme",
"actualDuration": "2 dakika 15 saniye",
"recordsLoaded": 192850,
"dataQualityScore": 98.2,
"errorsFound": 0
}
},
{
"timestamp": "2024-01-20T10:32:15Z",
"eventType": "AşamaBaşladı",
"description": "Süreç Keşfi aşaması başlatıldı",
"details": {
"stageName": "Süreç Keşfi",
"expectedDuration": "8-12 dakika",
"algorithm": "Alpha Miner Enhanced"
}
},
{
"timestamp": "2024-01-20T10:35:30Z",
"eventType": "KilometreTaşı",
"description": "Süreç modeli keşfedildi",
"details": {
"activitiesFound": 47,
"uniqueActivities": 47,
"processComplexity": "Orta"
}
},
{
"timestamp": "2024-01-20T10:38:22Z",
"eventType": "Uyarı",
"description": "Veri kalitesi sorunu tespit edildi",
"details": {
"issue": "Eksik zaman damgaları",
"affectedRecords": 125,
"resolution": "Zaman damgaları türetildi",
"impact": "Minimal"
}
},
{
"timestamp": "2024-01-20T10:41:10Z",
"eventType": "Hata",
"description": "Bellek limiti yaklaşıldı",
"details": {
"memoryUsage": "3.8 GB",
"memoryLimit": "4.0 GB",
"action": "Disk tabanlı işleme geçildi",
"performanceImpact": "İşleme %15 daha yavaş"
}
},
{
"timestamp": "2024-01-20T10:41:30Z",
"eventType": "AşamaTamamlandı",
"description": "Süreç Keşfi aşaması tamamlandı",
"details": {
"stageName": "Süreç Keşfi",
"actualDuration": "9 dakika 15 saniye",
"processVariants": 234,
"pathsDiscovered": 156
}
},
{
"timestamp": "2024-01-20T10:41:30Z",
"eventType": "AşamaBaşladı",
"description": "Performans Analizi aşaması başlatıldı",
"details": {
"stageName": "Performans Analizi",
"expectedDuration": "6-8 dakika",
"analysisTypes": ["Dar Boğaz", "Kaynak Kullanımı", "Süre Zamanı"]
}
},
{
"timestamp": "2024-01-20T10:45:33Z",
"eventType": "İlerleme",
"description": "Performans Analizi %78 tamamlandı",
"details": {
"stageName": "Performans Analizi",
"progress": 78,
"currentOperation": "Kaynak kullanımı analizi",
"recordsProcessed": 150243,
"remainingRecords": 42607
}
}
],
"upcomingEvents": [
{
"estimatedTime": "2024-01-20T10:48:00Z",
"eventType": "AşamaTamamlanma",
"description": "Performans Analizi aşaması tamamlanması bekleniyor"
},
{
"estimatedTime": "2024-01-20T10:48:00Z",
"eventType": "AşamaBaşlangıç",
"description": "Rapor Oluşturma aşamasının başlaması bekleniyor"
},
{
"estimatedTime": "2024-01-20T10:52:00Z",
"eventType": "İşTamamlanma",
"description": "İşin tamamlanması bekleniyor"
}
]
}
İş Performans Metriklerini Al
GET /api/{tenantId}/{projectId}/execution/job/{jobId}/metrics
İş yürütme için kaynak kullanımı, verimlilik, iş hacmi ve verimlilik ölçümleri dahil olmak üzere ayrıntılı performans metriklerini getirir.
Sorgu Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
interval |
string | Metrik toplama aralığı: 1m, 5m, 15m (varsayılan: 5m) |
metrics |
string | Virgülle ayrılmış metrikler: cpu, memory, disk, network, throughput |
includeHistory |
boolean | Tarihsel metrik verilerini dahil et (varsayılan: false) |
Yanıt
{
"jobId": "cc0e8400-e29b-41d4-a716-446655440000",
"metricsCollectionTime": "2024-01-20T10:45:33Z",
"currentMetrics": {
"resourceUtilization": {
"cpu": {
"usage": 67,
"cores": 2,
"efficiency": 89.2
},
"memory": {
"used": "2.3 GB",
"allocated": "4.0 GB",
"peak": "3.8 GB",
"efficiency": 87.5
},
"disk": {
"reads": "450 MB",
"writes": "89 MB",
"iops": 145,
"latency": "12ms"
},
"network": {
"bytesIn": "67 MB",
"bytesOut": "12 MB",
"connections": 8
}
},
"processing": {
"recordsPerSecond": 1250,
"recordsProcessed": 150243,
"totalRecords": 192850,
"processingEfficiency": 78.3,
"errorRate": 0.001,
"retryRate": 0.015
},
"stages": {
"completed": 2,
"running": 1,
"pending": 1,
"averageStageTime": "5.75 dakika",
"stageEfficiency": 91.2
}
},
"historicalMetrics": [
{
"timestamp": "2024-01-20T10:30:00Z",
"cpu": 15,
"memory": 0.8,
"recordsPerSecond": 0,
"stage": "Başlatma"
},
{
"timestamp": "2024-01-20T10:35:00Z",
"cpu": 85,
"memory": 1.9,
"recordsPerSecond": 1427,
"stage": "Veri Yükleme"
},
{
"timestamp": "2024-01-20T10:40:00Z",
"cpu": 72,
"memory": 3.2,
"recordsPerSecond": 1156,
"stage": "Süreç Keşfi"
},
{
"timestamp": "2024-01-20T10:45:00Z",
"cpu": 67,
"memory": 2.3,
"recordsPerSecond": 1250,
"stage": "Performans Analizi"
}
],
"performanceTrends": {
"cpuTrend": "Stabil",
"memoryTrend": "Azalan",
"throughputTrend": "İyileşen",
"overallEfficiency": "İyi",
"predictionAccuracy": 94.2
},
"benchmarks": {
"jobType": "ProcessMining",
"averageJobDuration": "18.5 dakika",
"averageThroughput": "1180 kayıt/saniye",
"currentPerformanceRank": "85. persentil",
"similarJobsComparison": {
"fasterThan": 85,
"similarTo": 12,
"slowerThan": 3
}
}
}
Birden Fazla İşi Takip Et
GET /api/{tenantId}/{projectId}/execution/tracking/batch
Dashboard görüntülemeleri ve toplu izleme için aynı anda birden fazla işin takip bilgilerini getirir.
Sorgu Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
jobIds |
string | Takip edilecek iş ID'lerinin virgülle ayrılmış listesi |
status |
string | Duruma göre filtrele: Çalışıyor, Kuyrukta, Tamamlandı, Başarısız |
submittedBy |
string | İşleri gönderen kullanıcıya göre filtrele |
includeMetrics |
boolean | Her iş için performans metriklerini dahil et (varsayılan: false) |
refreshInterval |
integer | Gerçek zamanlı takip için otomatik yenileme aralığı (saniye) |
Yanıt
{
"trackingTime": "2024-01-20T10:45:33Z",
"jobCount": 5,
"summary": {
"running": 3,
"queued": 1,
"completed": 1,
"failed": 0
},
"jobs": [
{
"jobId": "cc0e8400-e29b-41d4-a716-446655440000",
"jobName": "Müşteri Yolculuğu Analizi",
"status": "Çalışıyor",
"progress": 85,
"startTime": "2024-01-20T10:30:00Z",
"estimatedCompletion": "2024-01-20T10:52:00Z",
"currentStage": "Performans Analizi",
"submittedBy": "user123",
"priority": "Yüksek",
"resourceUsage": {
"cpu": 67,
"memory": "2.3 GB",
"processingRate": "1250 kayıt/saniye"
}
},
{
"jobId": "dd0e8400-e29b-41d4-a716-446655440000",
"jobName": "Satış Verisi Zenginleştirme",
"status": "Çalışıyor",
"progress": 45,
"startTime": "2024-01-20T10:35:00Z",
"estimatedCompletion": "2024-01-20T11:05:00Z",
"currentStage": "Veri Zenginleştirme",
"submittedBy": "system",
"priority": "Normal",
"resourceUsage": {
"cpu": 52,
"memory": "1.8 GB",
"processingRate": "890 kayıt/saniye"
}
},
{
"jobId": "ee0e8400-e29b-41d4-a716-446655440000",
"jobName": "Haftalık Rapor Oluşturma",
"status": "Kuyrukta",
"progress": 0,
"queuePosition": 2,
"estimatedStartTime": "2024-01-20T10:55:00Z",
"estimatedCompletion": "2024-01-20T11:20:00Z",
"submittedBy": "user456",
"priority": "Normal"
}
],
"systemHealth": {
"overallLoad": 73,
"queueHealth": "İyi",
"resourceAvailability": "Orta",
"estimatedCapacity": "6 ek iş"
}
}
İş Olaylarına Abone Ol
POST /api/{tenantId}/{projectId}/execution/job/{jobId}/subscribe
Gerçek zamanlı iş olaylarına abonelik sağlar. WebSocket bağlantılarını ve webhook bildirimlerini destekler.
İstek Gövdesi
{
"subscriptionType": "webhook",
"webhookUrl": "https://your-app.com/webhooks/job-events",
"events": [
"stageStarted",
"stageCompleted",
"progressUpdate",
"error",
"warning",
"jobCompleted"
],
"filters": {
"minProgressIncrement": 5,
"includeDebugEvents": false,
"notifyOnErrors": true
},
"authentication": {
"type": "bearer",
"token": "your-webhook-auth-token"
}
}
Yanıt
{
"subscriptionId": "sub-123e8400-e29b-41d4-a716-446655440000",
"jobId": "cc0e8400-e29b-41d4-a716-446655440000",
"subscriptionType": "webhook",
"status": "Aktif",
"webhookUrl": "https://your-app.com/webhooks/job-events",
"eventsSubscribed": [
"stageStarted",
"stageCompleted",
"progressUpdate",
"error",
"warning",
"jobCompleted"
],
"createdAt": "2024-01-20T10:45:33Z",
"expiresAt": "2024-01-20T18:45:33Z"
}
İş Bağımlılıklarını Al
GET /api/{tenantId}/{projectId}/execution/job/{jobId}/dependencies
İş bağımlılıkları hakkında ön koşul işler, bağımlı kaynaklar ve engelleme koşulları da dahil olmak üzere bilgi getirir.
Yanıt
{
"jobId": "cc0e8400-e29b-41d4-a716-446655440000",
"dependencies": {
"prerequisiteJobs": [
{
"jobId": "aa0e8400-e29b-41d4-a716-446655440000",
"jobName": "Veri Hazırlama",
"status": "Tamamlandı",
"completedAt": "2024-01-20T10:25:00Z",
"dependency": "Analiz öncesi veri kümesi doğrulanmalı"
}
],
"resourceDependencies": [
{
"resourceType": "Dataset",
"resourceId": "880e8400-e29b-41d4-a716-446655440000",
"resourceName": "Müşteri Yolculuğu Verisi",
"status": "Mevcut",
"lastModified": "2024-01-20T10:25:00Z"
},
{
"resourceType": "ComputeNode",
"resourceId": "worker-node-02",
"status": "Tahsis Edildi",
"allocatedAt": "2024-01-20T10:30:00Z"
}
],
"dependentJobs": [
{
"jobId": "ee0e8400-e29b-41d4-a716-446655440000",
"jobName": "Haftalık Rapor Oluşturma",
"status": "Kuyrukta",
"waitingFor": "Müşteri Yolculuğu Analizi sonuçları"
}
]
},
"blockingConditions": [
{
"condition": "Bellek tahsisi 2GB altı",
"status": "Çözüldü",
"resolvedAt": "2024-01-20T10:30:00Z",
"resolution": "Ek bellek tahsis edildi"
}
],
"dependencyGraph": {
"nodes": [
{
"id": "aa0e8400-e29b-41d4-a716-446655440000",
"type": "PrerequisiteJob",
"status": "Tamamlandı"
},
{
"id": "cc0e8400-e29b-41d4-a716-446655440000",
"type": "CurrentJob",
"status": "Çalışıyor"
},
{
"id": "ee0e8400-e29b-41d4-a716-446655440000",
"type": "DependentJob",
"status": "Kuyrukta"
}
],
"edges": [
{
"from": "aa0e8400-e29b-41d4-a716-446655440000",
"to": "cc0e8400-e29b-41d4-a716-446655440000",
"type": "prerequisite"
},
{
"from": "cc0e8400-e29b-41d4-a716-446655440000",
"to": "ee0e8400-e29b-41d4-a716-446655440000",
"type": "dependency"
}
]
}
}
Örnek: Tam İş Takip İş Akışı
Bu örnek kapsamlı iş takibi ve izlemeyi gösterir:
// 1. Bir işi takip etmeye başla
const trackJob = async (jobId) => {
// İlk iş durumunu al
const progress = await getJobProgress(jobId);
console.log(`İş takip ediliyor: ${progress.jobName}`);
console.log(`Mevcut ilerleme: ${progress.overallProgress.percentage}%`);
// Gerçek zamanlı olaylara abone ol
await subscribeToJobEvents(jobId);
return progress;
};
// 2. Ayrıntılı iş ilerlemesini al
const getJobProgress = async (jobId) => {
const response = await fetch(`/api/{tenantId}/{projectId}/execution/job/${jobId}/progress`, {
headers: {
'Authorization': `Bearer ${token}`
}
});
return await response.json();
};
// 3. Gerçek zamanlı iş olaylarına abone ol
const subscribeToJobEvents = async (jobId) => {
const response = await fetch(`/api/{tenantId}/{projectId}/execution/job/${jobId}/subscribe`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
subscriptionType: 'webhook',
webhookUrl: 'https://your-app.com/webhooks/job-events',
events: [
'stageStarted',
'stageCompleted',
'progressUpdate',
'error',
'warning',
'jobCompleted'
],
filters: {
minProgressIncrement: 10,
includeDebugEvents: false,
notifyOnErrors: true
}
})
});
const subscription = await response.json();
console.log(`İş olaylarına abone olundu: ${subscription.subscriptionId}`);
return subscription;
};
// 4. İş performans metriklerini al
const getJobMetrics = async (jobId) => {
const response = await fetch(`/api/{tenantId}/{projectId}/execution/job/${jobId}/metrics?interval=5m&includeHistory=true`, {
headers: {
'Authorization': `Bearer ${token}`
}
});
const metrics = await response.json();
console.log('Performans Metrikleri:');
console.log(` CPU Kullanımı: ${metrics.currentMetrics.resourceUtilization.cpu.usage}%`);
console.log(` Bellek Kullanımı: ${metrics.currentMetrics.resourceUtilization.memory.used}`);
console.log(` İşleme Hızı: ${metrics.currentMetrics.processing.recordsPerSecond} kayıt/saniye`);
return metrics;
};
// 5. İş yürütme günlüklerini al
const getJobLogs = async (jobId, level = 'INFO') => {
const response = await fetch(`/api/{tenantId}/{projectId}/execution/job/${jobId}/logs?level=${level}&limit=100`, {
headers: {
'Authorization': `Bearer ${token}`
}
});
const logs = await response.json();
console.log(`${logs.logs.length} günlük girişi alındı`);
// Son önemli günlükleri göster
logs.logs.filter(log => log.level !== 'DEBUG').forEach(log => {
console.log(`[${log.timestamp}] ${log.level}: ${log.message}`);
});
return logs;
};
// 6. Panelde birden fazla işi takip et
const trackMultipleJobs = async (jobIds) => {
const response = await fetch(`/api/{tenantId}/{projectId}/execution/tracking/batch?jobIds=${jobIds.join(',')}&includeMetrics=true`, {
headers: {
'Authorization': `Bearer ${token}`
}
});
const tracking = await response.json();
console.log(`${tracking.jobCount} iş takip ediliyor:`);
tracking.jobs.forEach(job => {
console.log(` ${job.jobName}: ${job.status} (${job.progress}%)`);
});
return tracking;
};
// 7. İş zaman çizelgesini izle
const getJobTimeline = async (jobId) => {
const response = await fetch(`/api/{tenantId}/{projectId}/execution/job/${jobId}/timeline?includeSubEvents=true&granularity=minutes`, {
headers: {
'Authorization': `Bearer ${token}`
}
});
const timeline = await response.json();
console.log('İş Zaman Çizelgesi:');
timeline.timeline.forEach(event => {
console.log(`[${event.timestamp}] ${event.eventType}: ${event.description}`);
});
return timeline;
};
// Kapsamlı takip iş akışını çalıştır
const runTrackingWorkflow = async (jobId) => {
try {
console.log('Kapsamlı iş takibi başlatılıyor...');
// İş ilerlemesini takip et
const progress = await trackJob(jobId);
// Performans metriklerini al
const metrics = await getJobMetrics(jobId);
// Yürütme günlüklerini al
const logs = await getJobLogs(jobId, 'WARN');
// Zaman çizelgesini al
const timeline = await getJobTimeline(jobId);
// Tamamlanana kadar izle
const monitoring = setInterval(async () => {
const currentProgress = await getJobProgress(jobId);
if (currentProgress.status === 'Completed') {
console.log('İş başarıyla tamamlandı!');
clearInterval(monitoring);
// Son metrikleri al
const finalMetrics = await getJobMetrics(jobId);
console.log(`Son verimlilik: ${finalMetrics.performanceTrends.overallEfficiency}`);
} else if (currentProgress.status === 'Failed') {
console.log('İş başarısız oldu!');
clearInterval(monitoring);
// Hata günlüklerini al
const errorLogs = await getJobLogs(jobId, 'ERROR');
console.log('Hata detayları:', errorLogs.logs);
} else {
console.log(`İlerleme güncellemesi: ${currentProgress.overallProgress.percentage}%`);
}
}, 30000); // Her 30 saniyede bir kontrol et
} catch (error) {
console.error('Takip iş akışı başarısız oldu:', error);
}
};
// Takibi başlat
runTrackingWorkflow('cc0e8400-e29b-41d4-a716-446655440000');
Python Örneği
import requests
import time
import json
from datetime import datetime, timedelta
class JobTracker:
def __init__(self, base_url, tenant_id, project_id, token):
self.base_url = base_url
self.tenant_id = tenant_id
self.project_id = project_id
self.headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
def get_job_progress(self, job_id):
"""Mevcut iş ilerlemesini al"""
url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/execution/job/{job_id}/progress"
response = requests.get(url, headers=self.headers)
return response.json()
def get_job_logs(self, job_id, level='INFO', limit=1000):
"""İş yürütme günlüklerini al"""
url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/execution/job/{job_id}/logs"
params = {'level': level, 'limit': limit}
response = requests.get(url, params=params, headers=self.headers)
return response.json()
def get_job_metrics(self, job_id, interval='5m', include_history=False):
"""İş performans metriklerini al"""
url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/execution/job/{job_id}/metrics"
params = {
'interval': interval,
'includeHistory': str(include_history).lower()
}
response = requests.get(url, params=params, headers=self.headers)
return response.json()
def get_job_timeline(self, job_id, include_sub_events=False, granularity='minutes'):
"""İş yürütme zaman çizelgesini al"""
url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/execution/job/{job_id}/timeline"
params = {
'includeSubEvents': str(include_sub_events).lower(),
'granularity': granularity
}
response = requests.get(url, params=params, headers=self.headers)
return response.json()
def track_multiple_jobs(self, job_ids, include_metrics=False):
"""Birden fazla işi aynı anda takip et"""