Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >SRE Interview Questions and Answers Simulation - Monitoring and Logging

SRE Interview Questions and Answers Simulation - Monitoring and Logging

原创
作者头像
行者深蓝
发布于 2024-09-08 02:45:33
发布于 2024-09-08 02:45:33
1910
举报

Monitoring

1. Metrics, Events/Logs, Tracing, and Profiling

  • Metrics: Real-time data, typically used for system monitoring.
  • Events/Logs: Event records used for tracking issues.
  • Tracing: Tracks the flow path of requests to help analyze performance bottlenecks.
  • Profiling: Analyzes program performance to identify bottlenecks and optimization points.

2. Metrics

  • Q: What are Metrics? A: Metrics are time-series data representing numerical values of system states and performance. They are regularly collected and recorded, such as CPU usage, memory consumption, and request response times.
  • Q: What are common monitoring metrics? A: These include resource usage (e.g., CPU, memory), application performance (e.g., request response time, error rates), and system health (e.g., Pod status).
  • Q: How to optimize the scraping frequency and storage strategy of Metrics? A: Optimize performance and storage by adjusting scraping frequency, using efficient storage and compression techniques, and setting a reasonable retention strategy.

3. Logs

  • Q: What are Logs? A: Logs record detailed system events and states, including application logs and system logs, to help analyze and troubleshoot issues.
  • Q: What are common types of logs? A: Application logs (logs from running applications), system logs (e.g., syslog), and Kubernetes container logs.
  • Q: How to manage and analyze large volumes of logs? A: Use centralized log management tools (e.g., ELK, Loki), apply log filtering, indexing, and persistence, and integrate log analysis with Metrics.

4. Events

  • Q: What are Events? A: Events record important state changes or behaviors in the system, such as the creation of Pods or the restart of containers in Kubernetes.
  • Q: How to effectively manage and analyze events? A: Use event-driven monitoring, trigger alerts or automated actions based on events, and optimize the collection and processing of event streams.

5. Tracing

  • Q: What is Tracing? A: Tracing records the path of requests across distributed systems, helping to understand service call chains and locate performance bottlenecks.
  • Q: What are common distributed tracing tools? A: Jaeger, Zipkin, OpenTelemetry.
  • Q: How to optimize the sampling rate for distributed tracing? A: Set a reasonable sampling rate to balance the precision of tracing data and the performance overhead on the system.

6. Profiling

  • Q: What is Profiling? A: Profiling records performance data of an application, such as CPU usage and memory allocation, helping to identify performance bottlenecks.
  • Q: What are common profiling tools? A: Go pprof, JVM Profiling, BPF/BCC.

7. APM (Application Performance Monitoring)

  • Q: What is APM? A: APM monitors application performance, including response times, throughput, and the performance of dependent services.
  • Q: What is the main purpose of APM? A: It helps identify performance bottlenecks, slow queries, memory leaks, and optimize application performance.

8. eBPF (Extended Berkeley Packet Filter)

  • Q: What is eBPF? A: eBPF is a kernel mechanism for efficiently capturing and analyzing system-level events, such as network traffic and system calls.
  • Q: How does eBPF differ from traditional monitoring? A: eBPF captures data directly at the kernel level, avoiding the performance overhead of user-space monitoring tools.

9. Agent

  • Q: What is a monitoring Agent? A: An Agent is a component that resides in the system to collect and send data, monitoring Metrics, Logs, and Traces.
  • Q: What are common Agent tools? A: Prometheus's Node Exporter, Fluentd, Telegraf, Datadog Agent.

10. OpenTelemetry

  • Q: What is OpenTelemetry? A: OpenTelemetry is an open-source framework that standardizes the collection of Metrics, Logs, and Traces, supporting cross-platform, multi-language observability.
  • Q: How does OpenTelemetry differ from traditional monitoring tools? A: OpenTelemetry provides standardized interfaces, supporting data collection and processing across multiple platforms and languages.

11. Prometheus Workflow and Metric Types

  • Workflow:
    • Data Scraping: Prometheus regularly pulls metrics data from configured endpoints.
    • Storage: Data is stored in a local time-series database.
    • Querying: Users query data through PromQL.
    • Alerting: Alerts are triggered based on configured alert rules.
    • Notification: Alerts are sent to notification systems.

12. Metric Types

  • Counter: A monotonically increasing counter, usually used to record the number of events (e.g., total HTTP requests).
  • Gauge: A value that can increase or decrease, representing a state (e.g., CPU usage).
  • Histogram: Records data distribution, mainly used for measuring response times (e.g., API response time).
  • Summary: Similar to a Histogram but provides more granular data (e.g., request latency percentiles).

13. Prometheus Service Discovery

代码语言:shell
AI代码解释
复制
- **Kubernetes**: Automatically discovers Pods and services.
- **Consul**: Uses Consul's service registration and discovery mechanisms.
- **Zookeeper**: Registers and discovers services through Zookeeper.
- **DNS**: Uses DNS SRV records for service discovery.
- **File-based**: Service discovery via static configuration files.

14. Common Prometheus Functions

代码语言:shell
AI代码解释
复制
- **rate()**
- **sum()**
- **avg()**
- **max()**
- **min()**
- **increase()**
- **histogram\_quantile()**

15. Thanos Architecture

  • Thanos is an extension of Prometheus providing long-term storage, global querying, and high availability. Main components include:
    • Thanos Sidecar: Deployed with Prometheus, uploads data to object storage.
    • Thanos Store: Reads data from object storage and supports queries.
    • Thanos Query: A unified query interface aggregating data from multiple Prometheus instances.
    • Thanos Compactor: Compresses stored data.
    • Thanos Ruler: Executes Prometheus rules and stores results in object storage.

16. Thanos vs. VictoriaMetrics

  • Thanos: Mainly extends Prometheus, providing long-term storage and global querying.
  • VictoriaMetrics: A high-performance time-series database compatible with Prometheus data format, offering efficient storage and querying.

17. Difference between Thanos Sidecar and Receive

  • Thanos Sidecar: Deployed alongside each Prometheus instance, uploads data to object storage and supports global querying.
  • Thanos Receive: Handles data reception from multiple Prometheus instances, enabling a highly available write path and data aggregation.

18. Thanos Rule Component vs. Prometheus

  • Thanos Rule: Executes Prometheus rules and stores results in object storage, supporting cross-cluster rule processing.
  • Prometheus: Has a built-in rule engine, with rules limited to the local Prometheus instance.

19. Prometheus Alerts

  • From Trigger to Notification Delay: Could involve data scraping frequency, rule evaluation intervals, and notification delivery delays.
  • Alert Suppression: Configurable rules to reduce duplicate alerts.
  • High Availability Alert Architecture: Use multiple Prometheus instances and Alertmanager for high availability.

20. Pod Metrics

  • WSS (Working Set Size): Indicates the amount of memory currently used by a process.
  • RSS (Resident Set Size): Indicates the actual physical memory used by a process.

21. Monitoring Optimization

  • Golden Metrics: Include latency, throughput, error rate, and saturation.
  • Optimizing Prometheus Performance: Use partitioning, optimize queries, and adjust sampling intervals.

22. Automated Responses and Data Persistence

  • Automated Alert Response: Integrate automation tools (e.g., Ansible) or use Alertmanager’s webhook functionality.

23. Data Compression and Persistence

Prometheus uses compression algorithms to store time-series data, and Thanos provides long-term storage solutions. Prometheus data compression and persistence principles: Prometheus stores data using TSDB (time-series database), applying efficient block storage and data compression algorithms (e.g., Gorilla compression) to reduce storage space.

24. kubectl top vs. Linux free Command Inconsistencies

kubectl top shows container-level resource usage, whereas free shows the overall node's memory usage, leading to discrepancies due to container overhead and cache differences.

25. Exporter and Troubleshooting

  • Common Exporters: Node Exporter, Blackbox Exporter, Redis Exporter, etc., used to expose different system metrics.
  • Troubleshooting: Check Prometheus logs, configuration files, target states, and ensure the exporter is functioning properly.

26. Target Down Troubleshooting

Check target network connectivity, Prometheus scraping configuration, and exporter status for issues when a target is down.

27. Prometheus Pull Model vs. Zabbix Push Model

  • Prometheus Pull Model: Prometheus periodically pulls data from target systems, making it suitable for dynamic environments and short-lived targets.
  • Zabbix Push Model: Target systems actively push data to Zabbix, which is ideal for static environments and scenarios that require mandatory data pushing.

28. Prometheus Operator

  • Adding Targets and Alert Rules: Targets and alert rules can be configured through the Custom Resource Definitions (CRDs) of the Prometheus Operator.

29. Exporter Outside the Kubernetes Cluster

  • Monitoring: In Prometheus configuration, add relevant jobs and targets to collect metrics from outside the Kubernetes cluster.

30. APM and eBPF Agent

  • APM (Application Performance Monitoring): Monitors application performance and provides in-depth application-level metrics.
  • eBPF (Extended Berkeley Packet Filter): Used for high-performance kernel-level monitoring, providing fine-grained system data.

31. OpenTelemetry

  • OpenTelemetry: An open standard that provides a unified way to collect, process, and export metrics, logs, and traces data.

32. Building an Observability Platform

  • Q: How to build a comprehensive observability platform? A: By integrating metrics, logs, tracing, and profiles, design a unified monitoring platform that supports multi-data source integration, automated alerting, and high availability.
  • Q: How to ensure high availability for the observability platform? A: Achieve high availability by ensuring redundancy of platform components, load balancing, and designing effective data storage and query optimization strategies.

ELK

Elasticsearch (ES) and related technologies involve deep discussions on indexing principles, storage mechanisms, performance optimization, and architecture design. Below are brief answers to each topic:

1. ES Indexing Principle

  • Elasticsearch writes documents to one or more shards, each of which is a Lucene index. Documents are written to an in-memory transaction log (translog) and are periodically flushed to Lucene index files on disk.

2. ES Storage Principle

  • Elasticsearch uses the Lucene library to store data. Data is partitioned into shards, each having its own inverted index, storage files, and transaction log. Data is stored in the form of JSON documents.

3. Full-text Search in ES

  • Queries are parsed and transformed into Lucene queries. ES looks up matching documents in the inverted index, calculates relevance scores, and returns the matching results.
  • ES Write Performance Optimization: Use bulk operations, adjust index refresh frequency, optimize the number and size of shards, configure appropriate memory and filesystem settings, and tune merge policies.

4. ES Query Performance Optimization

  • Optimize index mappings, fine-tune query syntax, use caches (e.g., query cache), configure the appropriate number of shards and replicas, and monitor and adjust JVM memory settings.

5. Troubleshooting High JVM Usage in ES

  • Monitor JVM garbage collection (GC) logs, analyze heap memory usage, check for thread and lock contention, and optimize ES configuration by adjusting heap size and garbage collectors.

6. ES Fleet Server Architecture

  • Fleet: A component of the Elastic Stack for centralized management of Elastic Agents. It provides a unified interface for managing and monitoring Elastic Agent instances.

7. Comparison of ClickHouse, Loki, and ES

  • ClickHouse: Best suited for high-performance, real-time analytics, especially for large-scale data aggregation queries.
  • Loki: Focuses on log data collection and storage, optimized for large-scale log data handling.
  • ES: Provides robust full-text search and flexible querying, ideal for scenarios requiring powerful search and analysis capabilities.

8. ES Full GC Troubleshooting

  • Check JVM GC logs, analyze the cause of Full GC, adjust heap size and garbage collector settings, and optimize ES indexing and query configurations.

9. Difference Between Young GC and Old GC in ES

  • Young GC: Focuses on collecting garbage in the young generation, occurring frequently for newly created objects.
  • Old GC: Collects garbage in the old generation, occurring less frequently but taking longer, dealing with long-lived objects.

10. Purpose of ES Versioning

  • The version field resolves concurrent update issues, ensuring that document updates do not overwrite other client updates.

11. ES Aggregation Types

  • Bucket Aggregation: Groups documents into buckets, e.g., by date, category.
  • Metric Aggregation: Performs calculations on numeric data, e.g., sum, average.
  • Pipeline Aggregation: Performs further calculations on aggregation results, such as moving averages.

14. How Filebeat Ensures Continuous Log Shipping

  • Filebeat uses built-in log rotation and retry mechanisms, ensuring continued log shipping even in the event of network failures or Filebeat restarts.

33. Data Storage Comparison: ES, Time Series DB, ClickHouse

  1. Elasticsearch (ES):
  • Data Type: Primarily used for log data.
  • Strengths: Powerful full-text search and querying capabilities, flexible index and mapping configurations, rich aggregation queries, and visualization support (e.g., Kibana).
  • Weaknesses: Not optimized for high-frequency time series data, storage and query performance is limited by data volume and index structure.
  • Time Series Database (e.g., Prometheus, InfluxDB):
  • Data Type: Optimized for time-series data (metrics).
  • Strengths: High-performance storage and query capabilities for time-series data, efficient storage compression, and built-in graphing and alerting features.
  • Weaknesses: Not suitable for non-time-series data (e.g., logs or complex text data).
  • ClickHouse:
  • Data Type: Handles large-scale data sets, including time-series data, logs, and complex queries.
  • Strengths: High-performance columnar storage for large-scale data, supports fast OLAP queries and aggregation operations, highly scalable with distributed deployment.
  • Weaknesses: Configuration and maintenance are complex; not specifically designed for time-series data.

Here is the translated Q/A simulation about the evolution of log systems, focusing on the key technologies like ELK (Elasticsearch, Logstash, Kibana) and the Grafana stack (including Grafana, Loki, Tempo), along with their characteristics, evolution, and suitable scenarios:

18. Q1: How has the evolution of log systems impacted enterprise operations and monitoring?

A1: The evolution of log systems has enabled enterprises to handle and analyze large volumes of log data more efficiently. Early log systems mainly focused on collecting and storing logs, whereas modern systems emphasize real-time analysis, visualization, and automated responses. This evolution allows enterprises to identify and resolve issues faster, improve operational efficiency, and gain deeper business insights.

19. Q2: What advantages does the ELK Stack offer in log processing and analysis?

A2: The ELK Stack offers robust log processing and analysis capabilities:

  • Elasticsearch: It stores and searches log data, supporting efficient full-text search and complex queries.
  • Logstash: Responsible for data collection, processing, and forwarding, supporting a wide variety of input and output plugins and data transformation and formatting.
  • Kibana: A visualization tool that helps users create dashboards and reports, facilitating real-time monitoring and data analysis.

20. Q3: How does Grafana’s Loki compare to the ELK Stack?

A3: Loki and ELK Stack both serve log management purposes, but they differ in design and use cases:

  • Loki: Focuses on simplifying log data storage and querying, tightly integrated with Grafana, and is highly efficient at handling large-scale log data. Its design is inspired by Prometheus, with a focus on efficient indexing and storage of logs but lacking full-text search capabilities.
  • ELK Stack: More feature-rich, with advanced search and analysis capabilities, though it might require more resources and configuration to handle complex queries and storage needs.

21. Q4: How should modern log systems be chosen?

A4: Choosing the right log system should consider factors like:

  • Data volume and processing needs: If you need to process large-scale log data and prioritize real-time analysis, Grafana Loki is a good choice. For scenarios that require complex search and analysis capabilities, ELK Stack is more suitable.
  • Integration and compatibility: Consider the integration needs with existing systems. If you already use Grafana for visualization, Loki might be easier to integrate.
  • Resources and management: ELK Stack may require more resources and management, while Loki offers a simplified log processing solution.

22. Q5: How can log storage and query performance be optimized in the ELK Stack?

A5: Performance in the ELK Stack can be optimized by:

  • Index management: Plan index strategies well, regularly optimize and merge indexes, and set appropriate index templates.
  • Hardware configuration: Add more nodes and configure memory and storage properly to improve processing power.
  • Query optimization: Optimize query statements, use proper data type mapping for fields, and enable caching mechanisms.

23. Q6: How does Grafana Tempo facilitate distributed tracing, and how does it work with the ELK Stack?

A6: Grafana Tempo is a high-performance distributed tracing system used for collecting and analyzing request trace data in distributed systems. When integrated with the ELK Stack:

  • Tempo: Works with Grafana to visualize distributed tracing, helping users understand delays and bottlenecks in requests.
  • ELK Stack: Can be used alongside Tempo to correlate log data with tracing data, providing comprehensive system monitoring and troubleshooting capabilities.

24. Q7: How can high availability and data backups be achieved in a log system?

A7: High availability and data backups can be achieved through:

  • ELK Stack: Configure Elasticsearch replicas and snapshots for data redundancy and backup.
  • Grafana Loki: Set up high-availability clusters and backup strategies to ensure reliable log data storage and recovery.
  • Overall: Implement load balancing, failover mechanisms, and regular backup strategies to enhance system reliability and data security.

25. Q8: What is the future trend of log system evolution?

A8: Future trends in log system evolution include:

  • Intelligence and automation: Incorporating more machine learning and artificial intelligence to automatically identify anomalies and offer optimization suggestions.
  • More efficient storage and retrieval: Continuous optimization of log storage formats and retrieval algorithms to improve performance and reduce costs.
  • Cross-platform integration: Enhancing integration with different data sources and platforms, providing a more unified and comprehensive monitoring solution.

These Q/As help understand the evolution of log systems and the pros and cons of related technologies. If there are specific questions or further discussion needed, feel free to ask!

We can also discuss the evolution of observability systems and the trends in internet technology by integrating ELK Stack, Grafana stack (including Loki, Tempo, etc.), and ClickHouse. Below is a Q/A simulation that explores how these technologies have evolved in data collection, processing, analysis, and visualization and how they adapt to modern trends.

26. Q1: How would you evaluate the role of ELK Stack in observability systems, particularly in data storage and querying?

A1: ELK Stack (Elasticsearch, Logstash, Kibana) holds a significant position in observability systems:

  • Elasticsearch: Offers powerful full-text search and complex querying, ideal for storing and analyzing large volumes of log data in real-time.
  • Logstash: Provides flexible data input and processing.
  • Kibana: Features a rich set of visualization tools for creating dashboards and charts, facilitating monitoring and analysis.

However, as data scales, the resource requirements and management complexity of ELK Stack increase, leading to the development of alternative technologies like Grafana Loki and ClickHouse.

27. Q2: What advantages do Grafana’s stack (Loki, Tempo) offer over ELK Stack?

A2: Grafana’s stack offers the following advantages:

  • Loki: Focuses on log data storage and querying, integrates seamlessly with Grafana, and optimizes log indexing and storage for large-scale log data. Inspired by Prometheus, it simplifies log handling and querying.
  • Tempo: Provides distributed tracing, integrating with Grafana to visualize request chains and help identify delays and bottlenecks in systems.
  • Grafana: As a visualization tool, supports multiple data sources (like Prometheus, InfluxDB, Elasticsearch) and provides a unified monitoring dashboard.

Compared to ELK Stack, Grafana’s stack tends to be more lightweight, easier to configure and extend, though it lacks the advanced query capabilities and full-text search of ELK Stack.

28. Q3: What advantages does ClickHouse offer in log and metric data storage and analysis?

A3: ClickHouse is a high-performance columnar database with the following advantages:

  • Efficient storage: Its columnar storage format is optimized for high compression rates, reducing storage costs.
  • Fast querying: Optimized for reading large volumes of data, especially useful for analytical queries and real-time analysis.
  • Scalability: Supports horizontal scaling, capable of handling petabyte-scale data.

ClickHouse’s high performance and compression make it an ideal choice for storing and analyzing log and metric data, particularly in scenarios requiring fast queries and large-scale data analysis.

29. Q4: How can a unified view of data be achieved in modern observability systems?

A4: A unified view of data can be achieved by:

  • Integrating different data sources: Use Grafana’s data source plugins to integrate different monitoring tools (like Prometheus, Elasticsearch, Loki, ClickHouse) into a single interface.
  • Data warehouse: Centralize data in a powerful data warehouse like ClickHouse to enable unified querying and analysis across all data.
  • APIs and data aggregation: Use APIs and data aggregation platforms to merge and analyze data from different tools, offering comprehensive views and insights.

30. Q5: How are current internet technology trends impacting observability systems?

A5: Current internet technology trends influence observability systems in the following ways:

  • Cloud-native and microservices: The adoption of cloud-native and microservice architectures increases the need for logs, metrics, and tracing data, driving the development of log management tools and distributed tracing systems.
  • Automation and intelligence: The growing demand for automated monitoring, fault detection, and self-healing systems encourages observability tools to integrate more machine learning and AI features.
  • Big data and real-time analysis: The need for real-time data analysis drives the development of high-performance databases (like ClickHouse) and stream processing technologies.
  • Data privacy and compliance: As data privacy concerns rise, observability systems are strengthening their support for data security and compliance.

31. Q6: How can high availability and disaster recovery be handled in observability systems?

A6: High availability and disaster recovery can be managed by:

  • Redundancy and backup: Configure redundant data storage and regular backups. In ELK Stack, Elasticsearch’s replication mechanism and snapshots ensure data redundancy. Grafana Loki achieves high availability through cluster mode and backup strategies.
  • Distributed deployment: Deploy systems across multiple data centers or cloud regions to ensure that if one region fails, others can take over.
  • Failover and recovery: Set up automatic failover mechanisms and disaster recovery plans to quickly restore system functionality and data.

32. Q7: What are the future trends in observability systems?

A7: Future trends in observability systems include:

  • Smarter analytics: More machine learning and AI features for automated anomaly detection and root cause analysis.
  • Seamless integration: Enhanced integration across different data sources, including logs, metrics, and traces, for a unified observability experience.
  • Cloud-native observability: Tools like Grafana’s stack and ELK Stack are increasingly optimized for cloud-native environments.
  • More efficient storage: Tools like ClickHouse are evolving to handle massive data volumes, providing fast querying and efficient data storage solutions.

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
Canvas入门到高级详解(下)
配套视频请戳:https://www.bilibili.com/video/av26151775/
老马
2019/05/25
3.6K0
第166天:canvas绘制饼状图动画
canvas绘制饼状图动画 1、HTML 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> 6 <title>饼状图面向对象版本</title> 7 <style> 8 bo
半指温柔乐
2018/09/11
1.6K0
第166天:canvas绘制饼状图动画
使用konvajs三步实现一个小球游戏
记得以前玩过一个很简单的小游戏,一个球在动,然后底下一个板来接,如果没接住撞到底边游戏就结束了,虽然忘了它叫什么名字,但一直心心念念,魂牵梦萦,刚好最近临过年需求不饱和、刚好之前一直想做但是没动手,刚好这两天在学习konvajs,刚好就有了这篇小文章,很简单,只要三步,包你三分钟学会。
街角小林
2022/06/15
7990
使用konvajs三步实现一个小球游戏
浅谈 Canvas 渲染引擎
用过 Canvas 的都知道它的 API 比较多,使用起来也很麻烦,比如我想绘制一个圆形就要调一堆 API,对开发算不上友好。
尹光耀
2023/03/16
2.9K0
浅谈 Canvas 渲染引擎
LeaferJS,全新的 Canvas 渲染引擎
前几天群里有人发了一个新 Canvas 渲染引擎的图片,看数据和宣传口号相当炸裂,号称只用 1.5s 可以渲染 100 万个矩形,还是个国产的。
尹光耀
2023/10/16
7710
LeaferJS,全新的 Canvas 渲染引擎
Canvas
http://www.w3c.org/TR/2dcontext/ https://html.spec.whatwg.org/
jinghong
2020/05/09
13.2K0
Canvas
前端推荐!10分钟带你了解Konva运行原理
导语 | Konva是一个很优秀的Canvas框架,API封装简洁易懂,基于TypeScript实现,有React和Vue版本。本文总结梳理了Konva的架构设计、原理及其缺点,希望可以为大家了解KonvaJS的相关问题提供一些参考。 一、前言 用过Canvas的都知道它的API比较多,使用起来也很麻烦,比如我想绘制一个圆形就要调一堆API,对开发算不上友好。 const canvas = document.querySelector('canvas');const context
腾讯云开发者
2021/10/13
5.5K0
HTML5(九)——超强的 SVG 动画
SVG 动画有很多种实现方法,也有很大SVG动画库,现在我们就来介绍 svg动画实现方法都有哪些?
呆呆
2021/09/30
3.8K0
【开源】微信小程序、小游戏以及 Web 通用 Canvas 渲染引擎 - Cax
用于分组, group 也可以嵌套 group,父容器的属性会叠加在子属性上, 比如:
用户1654868
2018/06/21
2.6K0
HTML5 Canvas的简单使用
参考这里 https://www.runoob.com/w3cnote/html5-canvas-intro.html
不愿意做鱼的小鲸鱼
2022/09/24
1.6K0
HTML5 Canvas的简单使用
Canvas系列(10):动画初级
所谓动画其实就是快读绘制图片,由于人的眼睛更不上屏幕绘制的速率,所以看到的就好像连着的一样,也就形成了动画,动画片就是这个原理,canvas中的动画也是这个原理。提到动画就不得不说一个函数了,那就是requestAnimationFrame。这是一个定时执行的函数,类似于setTimeout,只是间隔时间不再有我们自己手动去设定,而是由计算机自己去计算,这样比我们直接设定的误差更小(通常我们是定1000/60,约等于16.7毫秒,因为CPU的频率一般是60Hz,也就是1秒最多可以刷新60次界面)。但是往往浏览器对requestAnimationFrame的支持不够友好,那这就需要polyfill,通常一种简单的polyfill可以这么写:
kai666666
2020/10/19
8810
Canvas系列(10):动画初级
Fabric.js 从入门到________
如果你需要用 canvas 做特效,那我推荐你使用 Fabric.js ,因为 Fabric.js 语法更加简单易用,而且还提供了很多交互类的 api。
德育处主任
2022/04/17
14K0
Fabric.js 从入门到________
第167天:canvas绘制柱状图
canvas绘制柱状图 1、HTML 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> 6 <title>06柱状图面向对象版本</title> 7 <style> 8 bo
半指温柔乐
2018/09/11
1.4K0
第167天:canvas绘制柱状图
第154天:canvas基础(一)
​ <canvas> 是 HTML5 新增的,一个可以使用脚本(通常为JavaScript)在其中绘制图像的 HTML 元素。它可以用来制作照片集或者制作简单(也不是那么简单)的动画,甚至可以进行实时视频处理和渲染。
半指温柔乐
2018/09/11
8470
第154天:canvas基础(一)
三天学会HTML5——SVG和Canvas的使用
在第一天学习了HTML5的一些非常重要的基本知识,今天将进行更深层学习 首先来回顾第一天学习的内容,第一天学习了新标签,新控件,验证功能,应用缓存等内容。 第2天将学习如何使用Canvas 和使用SVG 实现功能 Lab1—— 使用Canvas Canvas 是指定了长度和宽度的矩形画布,我们将使用新的HTML5 JavaScript,可使用HTML5 JS API 来画出各种图形。 初始化 1. 创建HTML页面 <html> <head></head> <body></body> </html> 2.
葡萄城控件
2018/01/10
2.9K0
三天学会HTML5——SVG和Canvas的使用
第165天:canvas绘制圆环旋转动画
canvas绘制圆环旋转动画——面向对象版 1、HTML 注意引入Konva.js库 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>使用Konva绘制圆环旋转动画</title> 6 <script src="konva/konva.min.js"></script> 7 <script src="CircleText.js"></script
半指温柔乐
2018/09/11
2.5K0
第165天:canvas绘制圆环旋转动画
前端成神之路-WebAPIs06
回调函数原理:函数可以作为一个参数。将这个函数作为参数传到另一个函数里面,当那个函数执行完之后,再执行传进去的这个函数,这个过程就叫做回调。
海仔
2021/01/05
1.4K0
前端成神之路-WebAPIs06
html5 canvas 与小丑。
  以前开发动画应用你可能需要学习很复杂的动画制作框架。自从HTML5画布(Canvas)功能面世后,Web动画就一下子从云端跌落到了地面——任何一个Web程序员都可以轻易的用画布(Canvas)技术+JavaScript来开发出各种动画效果。
笔阁
2018/09/04
1.7K0
html5 canvas 与小丑。
「JavaScript 」动画基础 - 02
请注意,本文编写于 2085 天前,最后修改于 173 天前,其中某些信息可能已经过时。
曼亚灿
2023/05/17
4720
干货 | React 中的 Canvas 动画
移动端硬件性能越来越好的今天,页面的交互也越来越丰富,Web 体验在不断向原生应用靠拢,加入了越来越多的手势与动画。除了常见的 CSS 动画外,有时候我们还会使用到 Canvas 或者 SVG 进行动画内容表现。
携程技术
2021/12/13
3.3K0
干货 | React 中的 Canvas 动画
相关推荐
Canvas入门到高级详解(下)
更多 >
交个朋友
加入腾讯云官网粉丝站
蹲全网底价单品 享第一手活动信息
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档