Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Jquery & JavaScript
    • Git
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • Toggle search form

Tự tạo Command “php artisan” cho riêng mình trên web laravel

Posted on June 13, 2021December 28, 2021 By nim No Comments on Tự tạo Command “php artisan” cho riêng mình trên web laravel

Links list videos:

Các thứ chạy command laravel thì nằm hết trong func handler

$this->info() để in kêt quả ra ngoài màn hình.

câu lệnh tạo file command: php artisan make:command GetAllocationClusterDailyKubecost

Khai bao command sẽ gõ như thế nào

php artisan kubecost:getAllocationClusterDaily

Contents

  • 1) Option
  • 2) Print result.

1) Option

Để hứng được option {--days=} trong 1 function

Khi gõ command:

php artisan prometheus:pullAvailabilityMetrics --days=1
hoặc không có option cũng được:
php artisan prometheus:pullAvailabilityMetrics

https://viblo.asia/p/laravel-commands-5y8Rr6YbRob3

2) Print result.

$this->info($days);

echo sprintf("Process date %s, workload %s, duration %s, counter 5xx = %s, counter total = %s, error rate = %s, Max mem/cpu = %s/%s, Avg mem/cpu = %s/%s, Outage Duration = %s successfully",
            $date,
            $workloadName,
            $duration,
            $counter5xx,
            $counterTotal,
            (isset($errorRate) ? $errorRate : 'NULL'),
            $maxMemUsage,
            $maxCpuUsage,
            $avgMemUsage,
            $avgCpuUsage,
            $outageDuration,
        ) . PHP_EOL;
Laravel

Post navigation

Previous Post: Hướng dẫn delete branch git bằng command
Next Post: [error] Lỗi failed to parse field [host] of type [text] in document with id trên elk

More Related Articles

Vẽ chart cực đẹp bằng Morris JS và hướng dẫn fix lỗi morris không làm việc trên tab của bootstap Jquery & JavaScript
Các Lệnh query với Model của Laravel eloquent Laravel
[Popup/Ajax] Tạo popup(modal/bootstrap) insert data bằng ajax và php Coding
[SlackAPI/Laravel] Laravel call API Slack. Laravel
[Laravel] Handle datetime easily with Carbon in Laravel. Laravel
[PHP] Hướng dẫn kiểm tra array rỗng hay null không? Laravel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Argocd/Vault] Integrate Vault inside Argocd by the plugin July 1, 2022
  • [Vault] Using Service Acount of Kubernetes to login Vault system. June 28, 2022
  • Protected: My Assignment  June 24, 2022
  • [Spinnaker] Spinnaker writes too many logs – Reduce spinnaker log level June 22, 2022
  • [Jenkins] Jobs will be created automatically by Jenkins Job Builder June 20, 2022

Archives

  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Jenkins
    • Spinnaker
  • Coding
    • Git
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2022 NimTechnology.